Debugging iis express - not working
I am trying to debug an ASP.NET application using IIS Express.
When debug the application through Visual Studio 2022, everything works as expected, the application runs and debugging works as usual.
However, when I try to debug in Rider (started as admin), I got an error “HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure”.
I was able to fix this by replacing the generated applicationhost.config file by the one generated by Visual Studio and disabling the “generate applicationhost.config” setting in Rider.
The application now starts, however the “Sending debug request” fails with error “Failed to send a DEBUG request to IIS Express (\"500 Internal Server Error\"). It may indicate an invalid \"applicationUrl\" parameter in your launchSettings.json. Please check your settings”.
Disabling the “Send debug request” fixes this error. However, now the debugger never attaches. Trying to manually attach the process also does not work.
Am I doing something wrong? How can I make this work?
Launch settings:
Debug configuration settings
Please sign in to leave a comment.
May I know why the ASP.NET Core out-of-process hosting model for the .NET Framework 4.8 application?
In your Run/Debug Configuration the Target Framework is “.NET Framework”, which is not applicable with the hosting model. I don't think the application could be built successfully.
You can check the <TargetFramework> section in your
.csproj
file, switch to .NET Core versions, or use out of process hosting model by adding<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
.The application is developed with .NET framework 4.8, so I believe the Target Framework is correct. The application is being built successfully by Rider as well as Visual Studio. They both run the application successfully as well, given I use the applicationhost.config generated by Visual Studio for both.
The only difference is that Rider fails to debug the application.
Adding
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
does not seem to make any difference.Thomas Peire
The reason I asked for your target framework is I see ASP.NET Core Error Page in your screenshot, and you also add multiple ASP.NET Core configs in your environment variables, even the
launchsettings.json
is also only applied for ASP.NET Core application - I'm confusing why you said the application is based on .NET Framework 4.8.Try to invalidate IDE cache in File | Invalidate Caches, then delete the
.idea
folder in your solution root and reload the application in Rider, see if there is any improvement.If the issue is still there, you can prepare a sample project that could reproduce the issue on your environment, create a new support request in IDE Help | Contact Support.
Invalidating Caches and deleting the .idea folder did not work unfortunately.
I believe the issue has to do that the application has SDK style csproj files.
I created a sample application to reproduce the problem: ThomasPeire/Rider-17519251458578: iis debugging issue (github.com)
I understand, seems you encountered an existing issue, the SDK-style “targetframework” isn't supported in Rider yet.
RIDER-66190 SDK-Style Project Format for ASP.NET Web-Applications (.net Framework)
We would appreciate it if you would upvote it in order to bring increased awareness to the issue. One can also click
Watch
to monitor the status.