4
我搞砸了Visual Studio加载项API,试图查看我想要做的事情是否可能。有一件事我现在正在做的是一样的东西:如何在Visual Studio加载项中获取当前行号/异常情况?
public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
{
_applicationObject.Events.DebuggerEvents.OnExceptionThrown += DebuggerEvents_OnExceptionThrown;
handled = false;
if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
{
if(commandName == "MyAddin1.Connect.MyAddin1")
{
handled = true;
return;
}
}
}
void DebuggerEvents_OnExceptionThrown(string ExceptionType, string Name, int Code, string Description, ref dbgExceptionAction ExceptionAction)
{
//how to get line number here?
}
理想情况下,我希望能够得到当前函数和行号每当异常由正在调试的程序抛出。这可能吗?