Learning never exhausts the mind
Home >  Coding > C# ASP.Net MVC > Prevent Visual Studio Debugging Stopping when Browser Closed

Published 11th August 2019 by

As a web developer it is really frustrating when you close the browser tab or window only for Visual Studio to assume that you're done with the debugger as well. Turning this setting OFF will keep Visual Studio Debugger running when you close browser windows.

Visual Studio has a setting that automatically stops the debugger running when the project output window process is terminated. This however can be very annoying for three reasons. Firstly you may have closed the window by accident or not actually want the debugger to end. Starting the debugger again can take a long time to recompile and launch. Secondly you may have opened up other websites on the same browser process, and stopping the debugger in Visual Studio will terminate the browser so you lose those tabs as well. This can also close other windows or tabs launched from the main project output browser.

Luckily there is a setting within Visual Studio which will unlink the debugger and the browser so that closing the browser does not end the debugger and ending the debugger does not close the browser.

To find this setting, open the Visual Studio Options dialog from Tools menu and select Options. From there, locate Web Projects from the Projects and Solutions navigation tree.

Prevent Visual Studio Debugging Stopping when Browser Closed

Prevent Visual Studio Debugging Stopping when Browser Closed

Now untick the option box that says "Stop debugger when browser window is closed, close browser window when debugger stops."

Click on OK and now the browser window will not close when you stop debugging, and when you close the browser window the debugger will continue running.

Leave a Reply

Fields marked with * are mandatory.

We respect your privacy, and will not make your email public. Hashed email address may be checked against Gravatar service to retrieve avatars. This site uses Akismet to reduce spam. Learn how your comment data is processed.