1

Closing MS Edge DevTools stops a running Visual Studio web project. How do I prevent this?

I have a .NET MVC app that I am developing. For local testing and debugging I run the web project from Visual Studio using IIS Express. (Visual Studio Pro 2017 v.15.9.5)

It is not uncommon for me to open the Edge DevTools (F12) to inspect JS or CSS. The problem is that once the DevTools window is open if the DevTools are closed or even the web page is refreshed it causes Visual Studio to stop running/debugging the web application.

I have tried uninstalling the TelemetryCorrelation NuGet package (& its dependencies) from the project. I have made sure that the following configurations are unchecked in VS.

  • (unchecked) Enable Diagnostic Tools while debugging
  • (unchecked) Automatically close the console when debugging
  • (unchecked) Enable Edge Developers Tools for WUP JavaScript Apps (Chrome, Edge, and IE)

Using a different browser is not a solid option for me. I am writing an internal application and Edge is the "company supported" browser so I need to develop and debug with the same browsers my users will use.

EDIT before confirming as duplicate: Although my issue was the opposite from the debugger closing the browser, the same configuration changes fixed my issue. Weirdly the behavior I have reported was ONLY in Edge, not in FF or IE. I was not having the opposite issues, stopping the debugger did not close the browser.

I was overlooking the "Stop debugger when browser window is closed, close browser when debugging stops" configuration b/c I was looking under the "Debugging" configuration heading, not "Projects and Solutions".

Carmon Colvin
  • 58
  • 1
  • 8
  • 1
    https://blogs.msdn.microsoft.com/webdev/2018/06/29/changes-to-script-debugging-in-visual-studio-15-7/ – DavidG Feb 05 '19 at 16:33
  • 1
    Possible duplicate of [How to stop browser closing automatically when you stop debugging on VS 2017](https://stackoverflow.com/questions/40729535/how-to-stop-browser-closing-automatically-when-you-stop-debugging-on-vs-2017) – Liam Feb 05 '19 at 16:35
  • @Liam That looks like a whole different issue to me. OP has issue that VS 2017 stops debugging as a result of closing Dev Tools in MS Edge, not the other way around as in your link. – Peter B Feb 05 '19 at 16:37
  • 2
    While trying to fix this I was missing/overlooking the "Stop Debugger when browser window is closed, close browser when debugging stops" configuration checkbox. Leave it to MS to not have that configuration under the "Debugging" section. – Carmon Colvin Feb 05 '19 at 16:53
  • I'd imagine the solution is the same though, disable Javascript debugging – Liam Feb 05 '19 at 16:53
  • 1
    I can see that you had edited your original post and posted the solution in it. I suggest you to post your solution as an answer and mark it as an accepted answer after 24 hours when it is available to mark. It can help other community members in future who have similar kind of issue. Thanks for your understanding. – Deepak-MSFT Feb 06 '19 at 02:59

1 Answers1

1

My solution was to uncheck the "Stop debugger when browser window is closed, close browser when debugging stops" configuration in Visual Studio.

I was overlooking that configuration because I was looking under the "Debugging" configuration heading, not "Projects and Solutions".

Carmon Colvin
  • 58
  • 1
  • 8