VS2015 监视窗口不接受空条件语法 [英] VS2015 watch window does not accept the null-conditional syntax
问题描述
请注意:
它既不适用于立即窗口,也不适用于设置条件断点.
It works neither in the Immediate Window nor when setting a conditional breakpoint.
谁能解释一下我做错了什么?
Can anyone explain what am I doing wrong?
编辑 1
未选中使用旧版 C# 和 VB 表达式计算器.
但是,使用托管兼容模式被选中.但我记得打开它是为了解决 VS 2015 调试器中的错误.我需要更多时间来了解错误的详细信息.
However, Use managed compatibility mode is checked. But I remember turning it on in order to work around a bug in the VS 2015 debugger. I need some more time to get the details of the bug.
编辑 2
在 VS 2015 中未选中使用托管兼容模式,观察窗口功能失调.例如:
The watch window is dysfunctional with Use managed compatibility mode unchecked in VS 2015. For example:
注意,这是调试模式,而不是发布模式.我记得在调试时检查状态有很多问题,当时普遍的建议是打开使用托管兼容模式.
Note, that this is the Debug mode, not Release. I remember having a lot of issues with inspecting the state while debugging and that the prevailing recommendation was to turn on Use managed compatibility mode.
很遗憾,我无法迁移到 VS2017,因为我们的代码库仍然有一些 Silverlight 代码.
Unfortunately, I cannot move to VS2017, since our code base still has some Silverlight code.
当然,一旦我进入兼容模式,这种奇怪的行为就会消失.
Of course, this strange behaviour goes away once I am in the compatibility mode.
推荐答案
它应该可以工作 - 我刚刚在 VS 2015 (v14.0.25431.01 Update 3) 中尝试过,并且 null 条件语法在观察窗口中运行良好.
It should work - I just tried it in VS 2015 (v14.0.25431.01 Update 3), and the null conditional syntax worked fine in the watch window.
确保您没有选中使用旧版 C# 和 VB 表达式评估器"配置设置(在选项 -> 调试下).
Make sure you don't have the "Use the legacy C# and VB expression evaluators" config setting checked (under Options -> Debugging).
这篇关于VS2015 监视窗口不接受空条件语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!