Publish a .Net 5.0 web in IIS from Visual Studio 2019 doesn't start

1

I am trying to publish a test website in .Net 5.0 on an IIS on Windows 10.

  • I have .Net 5.0 installed
  • I have activated the IIS on Windows
  • I have installed the ASP.NET Core 5.0 Runtime (v5.0.1)
  • I have installed the dotnet-hosting-5.0.1-win
  • I have created the web application in the IIS and assigned it a specific Pool with the .Net CLR version "No code managed" and "Integrated". I have assigned the port 8090.

From Visual Studio when Publish I selected:

  • File System
  • Configuration: Release
  • Target Framework: 5.0
  • Deployment Mode: Self-Contained
  • Target Runtime: win-x86 (with win-x64 it doesn't work either)

My Windows version is 1909 (OS compilation 18363.1256)

If I navigate to the path http://localhost:8090/ I get this error "HTTP Error 500.32 - Failed to load .NET Core host.

I have reset the IIS, I have deleted and recreated the application, I have restarted Windows, but it still does not start the test web.

The Windows event viewer showed me these errors:

  • Unable to load 'C:\inetpub\wwwroot\TestNetCore.\hostfxr.dll'. This might be caused by a bitness mismatch between IIS application pool and published application.
  • Could not find 'aspnetcorev2_inprocess.dll'. Exception message:
  • Failed to start application '/LM/W3SVC/2/ROOT', ErrorCode '0x800700c1'.

I don't know what else to look at. Any ideas or suggestions?

enter image description here

enter image description here

asp.net
asp.net-core
iis
visual-studio-2019
.net-5
asked on Stack Overflow Dec 18, 2020 by Dalamar

1 Answer

5

Your errors are in ASP.NET Core, For these errors, you can try the following solutions:

  • Have you install asp.net core module? if not, please install it: ASP.NET Core Module
  • Open IIS manager > Application Pool > Select App pool > Advanced Settings, update "Enable 32 bits applications" from false to true > Click OK.

enter image description here

  • Try to delete the applicationhost.config (in .vs\config\applicationHost.config) and rebuild app.
answered on Stack Overflow Dec 21, 2020 by samwu

User contributions licensed under CC BY-SA 3.0