Search code examples
c#asp.netiisasp.net-coreasp.net-core-2.1

Aspnet core 2.1.4 IIS start issues


I made a simple POC in AspNet Core 2.1.2 a few days ago without any issue. I was able to run it either from IIS Express & local IIS (hosted or started/debugged via Visual Studio).

I updated the project to the latest AspNet Core 2.1.4 yesterday and cannot seem to run any AspNet Core application in my local IIS now.

I created a new project (without https) to be sure the migration wasn't the issue.

About my environment :

Test case :

  • Created an new "ASP.NET Core Web Application" -> API -> No authentication & no HTTPS
  • NetCore version 2.1

Once the solution is created, running it directly into IIS Express works. Selecting the other profile named with the application name also works (starts the console and the service correctly)

I then want to host it in my local IIS :

  1. Add a new website with a custom port (5555) and the physical path set to the solution folder (where sits the bin/obj/program.cs/...)
  2. Once created, browsing the site throws me a "Configuration error" : normal, there is no web.config available.
  3. I then right-clic on my project in VS, select "Properties" and "Debug"
  4. I Create a new profile as such : Profile
  5. I create a web.config file containing the following (and will be transformed as I change running profile) : Web.config
  6. The project is not "correctly setup" (correctly as my previous POCs with AspNet Core 2.1.2)

Issues :

  • If I try to browse the website through IIS, an error 500 occurs
  • If I try to debug the solution with the "IIS" profile, an error occurs as such : Startup error
  • All the HttpFailure*.html files are empty (0kb)
  • There is no error in the event viewer
  • There is no error in the IIS log files when enabled
  • There is no log file when the parameter stdoutLogEnabled is set to true (except when launched via a profile different than the IIS one, but still, no error)

Tests

I tried to :

  • Restart my computer
  • Start VS as administrator
  • Give full permission on the file system where applicable to "Everyone" and the IIS pool user selected

IIS Express & "console" profile still works.

EDIT1 : I also uninstalled everything and tried to revert to 2.1.2 without success (still with the latest VS)


Solution

  • I managed to find what was missing :

    In "Windows Features", the following element was not ticked : "Internet Information Services" -> "World Wide Web Services" -> "Common HTTP Features" -> "Http Errors"

    I know it was ticked before installing AspNet Core SDK/bundle, as detailed error pages were served.

    Anyway, as soon as this option was enabled again, I was greated with an error stating I cannot override the parameter XXX since it is locked. I had to set it as read/write in the server Feature Delegation.

    Then all went good.

    I cannot imagine the "Http Errors" was restored to an untick value by installing the SDK/bundle and didn't unticked myself (again, local computer).

    I'll put it on the IIS shenanigans tab...