Why do I always have to stop my app in IIS Express before restarting debugging in Visual Studio?

Viewed 167

I'm using Visual Studio Pro 2019, version 16.5.5. It recently (last month or so, maybe since 16.4.x) started doing this odd behavior for my ASP.NET Core application hosted using IIS Express for development.

  1. During a debug session I'll need to make code changes.
  2. I stop debugging in Visual Studio. IIS Express stops hosting.
  3. IIS Express inexplicably restarts my application unattached from VS.
  4. I make the code changes and try to hit Start Debugging.
  5. Visual Studio complains that all the output files are in use: MSB3026 Could not copy "obj\Debug\netcoreapp2.1\blah.dll" to "bin\Debug\netcoreapp2.1\blah.dll". Beginning retry n in 1000ms. The process cannot access the file 'bin\Debug\netcoreapp2.1\blah.dll' because it is being used by another process. The file is locked by: "Visual Studio 2019 Remote Debugger (27568), .NET Core Host (6264)"
  6. I right-click the IIS Express tray icon and click Stop Site under my application.
  7. I try to Start Debugging again in Visual Studio
  8. It brings up this dialog: enter image description here
  9. I hit OK and try again
  10. It finally starts debugging.

It's infuriating. I don't understand why IIS Express restarts the application. It's not being detached, the process stops then immediately restarts without debugging.

I can skip steps 2-5 by stopping debugging by stopping the IIS Site first. But that's not how it should work.

Is this some IIS Express configurating? I want to shoot my laptop, but then I would get fired.

0 Answers
Related