Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express not stopping when debug session ends

Tags:

All of a sudden IIS Express no longer stops when I stop debugging a web site in Visual Studio 2017.

I'm not sure when this behaviour started, but I have the following setup:

  • Visual Studio 15.5.2 (Has been repaired)
  • IIS Express 10.0 x64 (Reinstalled)
  • An ASP.Net Core 2 project targeting net461
  • I have disabled "Enable edit and continue" in Tools -> Options -> Debugging -> General

Not sure when this started happedning, maybe when I updated to the lastest VS version.

What more can I try?

like image 248
Joel Avatar asked Jan 05 '18 14:01

Joel


People also ask

How do I stop the IIS Express worker process?

Closing IIS Express By default Visual Studio places the IISExpress icon in your system tray at the lower right hand side of your screen, by the clock. You can right click it and choose exit. If you don't see the icon, try clicking the small arrow to view the full list of icons in the system tray.

How do I stop a debugging session?

Terminate a debug sessionClick the Stop button on the toolbar of the Debug tool window. Alternatively, press Ctrl+F2 and select the process to terminate (if there are two or more of them).

How do I Debug IIS Express?

To start debugging, select IIS Express or <IIS profile 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.


2 Answers

If Enable Edit and Continue is unchecked Then IIS Express stays running even after debugging is stopped.

You can uncheck it if you want here:

Right click your project » click Properties » select the Web tab » Enable Edit and Continue checkbox enter image description here

like image 92
Ramin Bateni Avatar answered Sep 28 '22 00:09

Ramin Bateni


For .net Core web projects in Visual studio 2017

If you add:

<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> 

or:

<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> 

in the first PropertyGroup in your project.csproj config you will alter the iis express behavior.

  • InProcess will kill iis express after debug.

  • If the setting is missing or set to OutOfProcess iis express will keep the process running.

- This setting updates the .vs\config\applicationhost.config of your solution and hostingModel="InProcess" will be added/removed to the iis express launch config for the project.

  <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" hostingModel="InProcess" /> 

(You don't need to change the applicationhost.config, only for reference)

like image 33
Simon Avatar answered Sep 28 '22 01:09

Simon