How to stop browser closing automatically when you stop debugging on VS 2017

For those of you who updated to Visual Studio 2019, that config is now under Tools > Options...

And then in the options dialog (see image below) Projects and Solutions > Web Project :
Uncheck Stop debugger when broswer window is closed, close browser when debugging

enter image description here


The reason for the change in behavior is due to VS 2017's support for debugging JavaScript/TypeScript running in Chrome. See announcement here https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/

To return to the 2015 behavior where Chrome is not closed by the debugger, disable the IE/Chrome script debugger in Tools -> Options like so:

Debugger options


Visual Studio 2017 version 15.7 and higher & Visual Studio 2019 changed things again.

Disabling the following checkboxes will allow you to keep the browser open (doesn't close after stop debugging) and opens another tab (instead of another window):

enter image description here

enter image description here

Tools > Options > Debugging > General

  • Disable "Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE)".

Tools > Options > Projects and Solutions > Web Projects

  • (Visual Studio 2017) Disable "Stop debugger when browser window is closed".
  • (Visual Studio 2019) Disable "Stop debugger when browser window is closed, close browser when debugging stops".