Publishing Web Application to IIS and Get Error on Page that Holds Database Info

110 views Asked by At

I have recently published my first app to an internal web server using IIS. The web application opens fine and I can view the Home and About pages just fine. However, when I click on the Children page (which contains a list from a database table), I get this error:

enter image description here

I do have the ASPNETCORE_ENVIRONMENT set to Production under the Solution properties, so I'm not quite sure why it is saying "Development Mode". Is there somewhere else that I need to change a setting?

I did try: Swapping to the Development environment displays detailed information about the error that occurred. I still received the same exact error!

Any assistance would be greatly appreciated. Please phrase your answer so that an extreme novice can understand it. In other words, don't just say change X w/o explaining where X is and what to change X to. Thanks!!

EDITED TO ADD: Here is a snip from program.cs

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
    // app.UseExceptionHandler("/Error");
    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.//
    app.UseHsts();
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthorization();

app.MapRazorPages();

app.Run();
0

There are 0 answers