1

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 generates 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.

4

2 回答 2

3

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;
于 2011-07-30T14:25:00.670 回答
2

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/

于 2011-07-26T12:13:36.530 回答