I have recently updated my Visual studio from 2015 to 2017 and started using 2017 now, but when I start debugging in it, it opens website in new browser tab and as soon as I stop debugging it closes the browser tab/website also.
Previously, in Visual Studio 2015, Browser tab never used to get closed as soon as I stop debugging.
So, how i can disable this new feature and keep website open/running even when debugging is stoppped in Visual Studio 2017?
You need to disable two things in your Visual Studio 2017 version 15.7 + higher & Visual Studio 2019
1. Disable "Enable JavaScript debugging for ASP.NET (Chrome, Edge, and IE)"
You can do this by navigating to "Tools -> Options -> Debugging -> General" and then uncheck "Enable JavaScript debugging for ASP.NET (Chrome, Edge, and IE)"
2. Disable "Stop debugger when browser window is closed".
You can do this by navigating to "Tools -> Options -> Projects and Solutions -> Web Projects" and then uncheck "Stop debugger when browser window is closed"
OR
If your project is .net core: you can also try this in Properties folder -> launchSettings.json file set this config :
"launchBrowser": false,
And in Visual Studio 2022, "Tools -> Options -> Projects and Solutions -> Web Projects" and then uncheck "Stop debugger when browser window is closed" as shown in the above image.
If you are using visual studio 2022, navigate to Tools -> Options -> Projects and Solutions -> Web Projects -> From the options on "Right" pane
uncheck: Stop debugger when browser window is closed, close browser when debugging stops
as shown in the below image
Also, If your project is .net core, check in Properties folder -> launchSettings.json file set this config :
"launchBrowser": false,
(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".
Thanks
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly