ASP.Net core 2.2 deployment issue in IIS

asp.net-core-2.2iis

I am new to .Net core environment and facing issue while deploying application into IIS.

After publishing code and deploying into IIS server(Version 7), I am able to start application from Kestrel by going into directory where application hosted and running below command.

c:\inetpub\demoapp\dotnet "My App.dll"

By running above command, Kestrel is running on http://localhost:5000 and I am able to browse from browser. I am using latest .Net Core version 2.2.

But when I am trying to execute URL from IIS hosted application, I am getting below error.

HTTP Error 502.5 – ANCM Out-Of-Process Startup Failure

Below is the event log from windows application log.

Application '/LM/W3SVC/49/ROOT/demoapp' with physical root 'C:\inetpub\demoapp\' failed to start process with commandline 'dotnet .\MyApp Web.dll' with multiple retries. The last try of listening port is '2405'. See previous warnings for details.

Anyone having idea how to resolve it?

Best Answer

In my case, It was win-64 architect issue.

You can change or switch architect from win-64 to win-86 then publish and don't forget to change Enable 32-bit Applications in IIS manager:

  • Right-click on the Application Pool and select “Advanced Settings…” or select the same from the Actions pane after selecting the Application pool.

  • Change the “Enable 32-bit Applications” to True (if you want the application pool to spawn in a 32-bit mode) Click OK.

p.s.: Don't forget to delete existing published files.

Related Topic