我想暂时禁用一个断点,所以我设置一个条件断点,具有以下条件:
(global::System.DateTime.Now<new global::System.DateTime(2014,03,28,11,0))
当这个断点被击中时,弹出一个对话框,说
The condition for a breakpoint Failed to execute. The condition was '(global::System.DateTime.Now<new global::System.DateTime(2014,0))'. The error returned was 'The runtime has refused to evaluate the expression at this time.'. Click OK to stop at this breakpoint.
为什么运行时拒绝评估表达式?
解决方法
从VS2012开始,您必须切换到托管兼容模式,才能使用条件断点.为什么和如何描述这里:
switching-to-managed-compatibility-mode-in-visual-studio-2013