开发者

Getting the instance of EnvDTE.Debugger in VS2010

开发者 https://www.devze.com 2023-03-23 03:21 出处:网络
I\'m trying to create a Visual Studio Integration Package project which will display data from the debugger.

I'm trying to create a Visual Studio Integration Package project which will display data from the debugger.

So I found the EnvDTE namespace, that looks to give me the needed classes and methods.

According to the documentation for VS2005, the following code should be used to get an instance of the debugger:

EnvDTE.Debugger _debugger;
_debugger = EnvDTE.DTE.Debugger;

But this generat开发者_如何学Pythones an error in VS2010 - An object reference is required for the non-static field, method, or property 'EnvDTE._DTE.Debugger.get'

How can I interrogate the debugger in VS2010?

Thanks in advance.


To access DTE's debugger from a VS Package, call GetService on your Package object, as in:

DTE2 dteInstance = (DTE2) _package.GetService(typeof(SDTE));
Debugger4 dteDebugger = (Debugger4) dteInstance.Debugger;


Maybe better way would be create Debugger visualizer, look at the Mole AFAIK it's by far most capable debugger visualizer and for old version source is available

http://karlshifflett.wordpress.com/mole-2010/mole-for-visual-studio/

0

精彩评论

暂无评论...
验证码 换一张
取 消