是否有一个选项或注册表设置来阻止Visual Studio在遇到断点时自动聚焦?
我不希望Visual Studio自动聚焦的原因是因为我在调试软件时倾向于进行多任务处理.当我启动调试器时,应用程序可能需要一段时间才能编译并命中断点.我通常需要等待时间来回复电子邮件.
当我输入我的电子邮件时,调试器会使Visual Studio专注于突破线,当我输入我的电子邮件时,我会不小心修改源代码.
您可以使用 Visual Studio 2019 中的选项设置轻松禁用/启用此行为:
工具 -> 选项 -> 调试 -> 常规 -> 在调试器中中断时将 Visual Studio 带到前台
我不知道这个功能是在哪个 Visual Studio 版本中添加的。
小智 5
我无法找到任何类型的配置设置来关闭它,但能够找到一个解决方法的人; 跟踪点.
1. Set your breakpoint at the desired location.
2. Right-click on the red breakpoint dot icon and select “When Hit…”
3. Select “Print a message”.
4. Uncheck “Continue execution”.
You have effectively created a breakpoint that prints out the current function name and thread ID and name and then stops. Tracepoints don’t steal focus like normal breakpoints do.
Run Code Online (Sandbox Code Playgroud)
学分归于:http://dpotter.net/technical/2009/09/problem-solved-visual-studio-stealing-focus-when-breakpoint-is-hit/
| 归档时间: |
|
| 查看次数: |
1798 次 |
| 最近记录: |