切换“抛出异常时中断".使用宏或键盘快捷键 [英] Toggle "Break when an exception is thrown." using macro or keyboard shortcut

查看:22
本文介绍了切换“抛出异常时中断".使用宏或键盘快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio 2015 的新异常窗口比我不再关心使用键盘的旧对话框它的捷径.

Visual Studio 2015's new exception window is so much faster than the old dialog that I no longer care as much about using a keyboard shortcut for it.

是否有宏或键盘快捷键可以在不使用 GUI 的情况下切换抛出异常时中断"?

Is there a macro or keyboard shortcut that will toggle "break when an exception is thrown" without using the GUI?

使用 ctrl+alt+e 打开对话框并选中Common Language Runtime Exceptions"Thrown"框,然后单击 OK 很简单,但这是我经常做的事情.我宁愿为此设置一个键盘快捷键.

Opening the dialog with ctrl+alt+e and checking the "Common Language Runtime Exceptions" "Thrown" box then clicking OK is simple enough, but this is something I do a lot. I would rather have a keyboard shortcut for this.

这个问题是重复的任何有视觉用于在已处理/未处理异常上切换中断的 Studio 快捷方式/宏?

然而,发帖人接受了一个并不真正有效的答案,我真的很想要一个确实有效的答案.

However, the poster accepted an answer that doesn't really work, and I would really like an answer that does work.

重复问题中的答案是不可接受的,因为它只切换一个特定的异常,而不是整个 CLR 组.

The answer in the duplicate question is not acceptable because it toggles only one specific exception, not the entire CLR group.

那么写一个循环."你说.但没那么快!有人已经尝试过了 并且它非常缓慢.(是的,我已经确认它在我的系统上也很慢.)

"Well write a loop then." you say. But not so fast! Someone tried that already and it was uselessly slow. (Yes I've verified that its slow on my system as well.)

因此挑战在于使用宏在不到 1 或 2 秒的时间内切换整个 CLR 异常类别.这个问题是重复的任何有视觉用于在已处理/未处理异常上切换中断的 Studio 快捷方式/宏?

So the challenge is to use a macro to toggle the entire CLR Exceptions category in less than 1 or 2 seconds. This question is a duplicate of Any have a Visual Studio shortcut/macro for toggling break on handled/unhandled exceptions?

推荐答案

我创建了一个免费的 Visual Studio 扩展,可以可靠地做到这一点:异常断路器.
它使用未记录的 IDebugSession2.SetException 调用非常快:所有异常都在 20 到 60 毫秒内设置/取消设置.

I have created a free Visual Studio extension that can do that reliably: Exception Breaker.
It uses undocumented IDebugSession2.SetException call that is very fast: all exceptions are set/unset in 20 to 60 milliseconds.

这篇关于切换“抛出异常时中断".使用宏或键盘快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆