Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Startup Project keeps reverting to IIS Express for debugging

In my solution I basically have two projects, the one I'm coding on, and the startup project, Startup.csproj. I have Startup.csproj configured to use Local IIS for debugging, and I normally just attach to the worker process to debug.

However, at random intervals, the Startup.csproj defaults back to IIS Express for debugging. It does not show as a change in the Startup.csproj project file, and sometimes even still shows Local IIS but fails with a "Cannot list contents of directory" error.

I'm running VS 2017 v15.9.15. What could be causing this annoying little phenomenon?

like image 541
ProfK Avatar asked Oct 18 '19 10:10

ProfK


People also ask

How do I stop Visual Studio from opening a new browser?

Go to Project Properties > Debug > Uncheck "Launch Browser" > Save. Save this answer.

How do I debug IIS Express?

To start debugging, select IIS Express (<Browser name>) or Local IIS (<Browser name>) in the toolbar, select Start Debugging from the Debug menu, or press F5. The debugger pauses at the breakpoints. If the debugger can't hit the breakpoints, see Troubleshoot debugging.


1 Answers

I thought I am going crazy. I found the settings driving that behavior in the project file. I set the UseIISExpress to 'false' and the other one all the way at the end of the file project UseIIS to 'true' and when reloading still set to use IISExpress.

Turns out there's a <ProjectFile>.csproj.user that will overwrite default settings. Search for the UseIISExpress in this file and set it to false and Voila! problem solved.

like image 187
Mircea Ion Avatar answered Oct 21 '22 10:10

Mircea Ion