ASP.NET Core 2.1 - Unable to start process dotnet.exe

2

After upgrading an application from .NET Core 1.0 to 2.1, I am receiving the following error when I try to debug it with IIS Express:

Unable to start process C:\Program Files\dotnet\dotnet.exe. The web server request failed with status code 502, Bad Gateway.

However, this only happens every second time I launch the application. Otherwise it works just fine if I just launch it again. This creates a mild nuisance to my debugging process, as I constantly have to keep closing the error windows popping up.

The full response shows some additional info:

HTTP Error 502.3 - Bad Gateway
The specified CGI application encountered an error and the server terminated the process.

And the error code "0x80072efe" is shown.

Logging is enabled in web.config, but the crashing launches are not shown at logs at all. I have also tried looking Event Viewer for additional information, but I have not found anything. The only fix for this I have found so far is to set Kestrel use libuv instead of sockets, but I have no idea why it works. Does anyone have any idea how to fix this?

asp.net-core
.net-core
iis-express
asked on Stack Overflow Oct 12, 2018 by Ville

1 Answer

0

I encountered the same problem after I upgraded, regardless of what I did it would always show the 502 error on the second load. It appears this problem was introduced in ASP.NET Core 2.1. I tracked it down to the asp-prerender-module tag in my view. Remove the prerender and it goes away.

I was able to fix the problem and keep my prerendering by upgrading to ASP.NET Core 2.2.

answered on Stack Overflow Jan 9, 2019 by James

User contributions licensed under CC BY-SA 3.0