简体   繁体   中英

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM