0
votes

I have .NET Core web application targeting net461 framework. And I tried to publish it to IIS. What I have followed this guide and after accessing page I got this:

enter image description here

I checked following:

  • There is folder .\logs\stdout and IIS has full control to read/write, logging is enabled but not log file is created
  • AppPool has selected No Managed Code
  • In Event Viewer no errors are shown under Windows Logs/Application
  • In IIS logs there is no useful information

Then I decided that I'll make empty .NET Core app also target net461 and deploy it to IIS. I followed exact same steps and this empty "Hello World!" app works.

Then I noticed that application that does not work have ASP.NET section and other don't. Why is that?

enter image description here

1
double check your app poolagua from mars
Do you have a stdoutLogEnabled="true" attribute on your <aspNetCore /> element in your web.config?willwolfram18
I am not sure what do you mean by targeting net461 framework with .NET Core web application. Can you right click your asp.net web application project in Solution explorer and then click Edit and check the <TargetFramework>. I think your web application is targeting .NET Framework and not .NET Core thats why when you are trying to host it under AppPool with No Managed Code it is causing errorMohsin Mehmood
Can you run the app alone successfully?Lex Li
@MohsinMehmood Looks like that was not it. ASP.NET Core app can target net461 framework and runs under AppPool with No Managed CodeMatjaž Mav

1 Answers

2
votes

After I set environment variables ASPNETCORE_DETAILEDERRORS and ASPNETCORE_CAPTURESTARTUPERRORS to true, I was able to see exception in browser and successfully debug a problem.

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/web-host?view=aspnetcore-2.1