[英]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). 我有一个VSPackage,我希望在调试模式下获取类似于本地窗口中显示的信息(当前上下文的变量值)。
I have been experimenting with the DTE.Debugger.CurrentStackFrame instance which looked interesting because it exposed Argument and Local collections of expressions. 我一直在试验DTE.Debugger.CurrentStackFrame实例,它看起来很有趣,因为它暴露了Argument和Local表达式集合。 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.
但是,我无法看到将表达式的值作为对象获取的方法 - Value属性似乎只是ToString值。
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.
主要是因为该值与VS Package在同一进程中不存在。 It exists in the debugee process.
它存在于debugee过程中。 The Visual Studio Debugger has to go through the CLR API's to manipulate the value.
Visual Studio调试器必须通过CLR API来操作值。 The best you can do is get ahold of the string value from the VS Package.
您可以做的最好的事情是从VS包中获取字符串值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.