Visual Studio 包 - 如何获取本地窗口中的信息?

发布于 2024-08-19 17:03:58 字数 192 浏览 4 评论 0原文

我有一个 VSPackage,我想在调试模式下获取与本地窗口中显示的信息类似的信息(当前上下文的变量值)。

我一直在尝试 DTE.Debugger.CurrentStackFrame 实例,它看起来很有趣,因为它公开了 Argument 和本地表达式集合。但是,我看不到将表达式的值作为对象获取的方法 - Value 属性似乎只是 ToString 值。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

羁客 2024-08-26 17:03:58

不可能将值作为对象来获取。主要是因为该值与您的 VS 包不存在于同一进程中。它存在于被调试进程中。 Visual Studio 调试器必须通过 CLR API 来操作该值。您能做的最好的事情就是从 VS 包中获取字符串值。

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.

只为一人 2024-08-26 17:03:58

您可以使用 Visual Studio Visualizer 访问实际对象。可以在此处找到该信息。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文