Alan Spark
Alan Spark

Reputation: 8292

Visual Studio Package - How can I get hold of the information in the locals window?

I have a VSPackage that I would like to get information similar to that shown in the locals window when in debug mode (the values of variables for the current context).

I have been experimenting with the DTE.Debugger.CurrentStackFrame instance which looked interesting because it exposed Argument and Local collections of expressions. However, I can't see a way of getting the value of an expression as an object - the Value property just seems to be the ToString value.

Upvotes: 3

Views: 430

Answers (2)

Eric
Eric

Reputation: 1

You can get access to actual objects using a Visual Studio Visualizer. The info can be found here.

Upvotes: 0

JaredPar
JaredPar

Reputation: 754595

It is not possible to get ahold of the value as an object. Mainly because the value doesn't exist in the same process as your VS Package. It exists in the debugee process. The Visual Studio Debugger has to go through the CLR API's to manipulate the value. The best you can do is get ahold of the string value from the VS Package.

Upvotes: 5

Related Questions