首页 > 解决方案 > Visual Studio 2019:关闭浏览器窗口时停止调试器,但在调试停止时不关闭浏览器

问题描述

在此处输入图像描述

如果我关闭运行 Web 应用程序的浏览器,调试会话最好终止。毕竟,这等于关闭了一个windows应用程序。但是,如果我停止调试并且浏览器有多个选项卡(通常是这种情况),所有选项卡都会关闭——这绝对不是我想要的。不使用此选项意味着我不断忘记调试器正在运行并且单击停止按钮只是额外的工作。

是否有 Visual Studio 的附加组件或任何其他仅允许执行第一个操作的技巧:关闭窗口时停止调试器?

谁认为在一个复选框后面放置两个选项是个好主意?这是一把最锋利的双刃剑!

标签: visual-studiodebugging

解决方案


It's not exactly what you want. But, it might be a workaround. If you enable JavaScript debugging in Tools->Options->Debugging and then you Debug->Detach All. The browser should stay open and debugging should stop... Now it would mean that the application is still running, which might not be desirable.

It's a great suggestion to make this an option. I'd encourage you to open a suggestion on developer community.

Tools Options:

Tools Options

Detach:

Debug Menu


推荐阅读