How do I stop from browser being closed when I stop debugging in Visual Studio 2017?


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?


Asked by:- manish
1
: 10201 At:- 10/8/2018 10:31:11 AM
Visual-studio visual-studio-2017 stop-browser-from-being-closed-in-visual-studio-2017







2 Answers
profileImage Answered by:- jon

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)"

stop-from-browser-being-closed-debugging-visual-studio-2017-min.png

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"

uncheck-stop-debugger-when-browser-window-visual-studio

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.

3
At:- 10/8/2018 5:21:29 PM Updated at:- 12/14/2022 5:58:11 AM


profileImage Answered by:- bhanu

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

stop-browser-min_1.png

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

2
At:- 10/19/2021 3:54:02 PM Updated at:- 4/19/2022 4:02:15 PM
Thanks for the updated details for new version of Visual Studio . 0
By : manish - at :- 4/29/2022 2:17:59 PM






Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly