How can I prevent Visual Studio 2013 from closing my IIS Express app when I end debugging?
Solution 1
Turning off the new "Enable Edit and Continue" feature fixed it for me.
- Open Options dialog box (Tools | Options)
- Locate "Debugging\Edit and Continue"
- Uncheck "Enable Edit and Continue"
Update 1:
You can also turn it off on a per project basis.
- Open properties for web project
- Select Web tab
- Uncheck "Enable Edit and Continue" in the "Debuggers" section
Update 2: Blog article that discusses this feature.
Solution 2
Easier solution:
From Debug
menu select Start Without Debugging
or Ctrl+F5
to run the project, it will keep running your project unless you quit IIS.
Solution 3
I didn't have "Enable Edit and Continue" in my web project's properties (VS2015 Community Update 2), but finally I found a useful comment in this link which mentioned in Rick's answer:
Christian: You don't need to turn the option off for IIS express to keep running. All you need to do is instead of stopping your application, detach all processes. If you go: Tools > Customize > click the commands tab. Then select toolbar radio button and on the drop down next to this select debug. You then want to "Add Command…". On Add Command window select debug and scroll down to and click on "Detach All". Click OK and then just close. You will see a red cross next to your debug menu. When you click this after debugging your application IIS Express will continue to run.
Related videos on Youtube
Ryan Peters
I absolutely love what I do and it is my passion. At my current position, I worked primarily using Microsoft technologies to create and maintain client-facing and internal web applications used throughout the company. All applications leveraged ASP.NET/C#, the MVC framework, WCF/ASMX/REST web services in a SOA, custom DAL wrappers, with SQL server as a storage tier. By night I'm a father of two amazing (also hectic). I also enjoy playing music and PC gaming.
Updated on February 23, 2020Comments
-
Ryan Peters about 4 years
Previously in 2012, if I debugged in Chrome (for example), and then stopped the debugger, the website would remain running in IIS Express. This no longer seems to be the case in 2013.
Is this a new change that I need to make? How can I keep the website instance running even after I stop the debugger? Thanks.
-
Josh M. over 9 yearsBut if you disable Edit and Continue then you can't edit code while debugging!
-
Josh M. about 9 yearsEdit and continue? Yes, it's a huge time saver. If you're not using edit and continue, you're doing it wrong! ;-)
-
Zarepheth almost 9 yearsEdit and Continue is useful when debugging and testing web projects. That *.aspx files can be edited, the browser refreshed, and changes will appear. It's not so useful for non-web code...
-
Adam Heeg almost 9 yearsso if you have your logic in another file, or even in another library it is useless?
-
Mikee almost 8 yearsThere is no Detach All in VS 2015 Enterprise Update 2.
-
JRadness almost 8 yearsIf you need edit and continue in a web project you are doing it wrong. You shouldn't be testing your code by debugging. You should have tests than are easy to start and stop! :)
-
Dai almost 8 years@Mikee "Detach All" only appears in the Debug menu when you're already in Debug mode. You can also manually add the command via
Add Command.. > Debug > Detach All
. -
sohaiby almost 8 yearsnot working in Visual Studio Community 2015 Update 2. I have done the needful and IISExpress still stops midway
-
Moshe L over 6 yearsWorks on VS 2017. Thanks !!