以编程方式评估表达式/调试
我正在编写一个 Visual Studio 插件,没什么大不了的,只是为了实验。
我需要在调试器运行时评估一段代码,并且对我来说很难在 SO 中搜索/搜索它。
假设将鼠标悬停在 Person1.Name
上,它将显示 "JustAName"
。我希望在执行命令时从我的加载项代码中计算字符串 "Person1.Name"
(位于调试器上下文中)并获取字符串 "JustAName".
这可能吗?
I'm writing a Visual Studio Add-In, nothing serious, just to experiment.
I need to evaluate a piece of code when the debugger is running, and It's being very hard for me to google / search in SO for it.
Let's say that hovering Person1.Name
it will display "JustAName"
. I want from my add-in code, when a command is executed, evaluate the string "Person1.Name"
(which is in the debugger context) and get the string "JustAName"
.
Is that possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Debugger.GetExpression() 方法。
Use the Debugger.GetExpression() method.