“Cannot evaluate expression because the code of the current method is optimized” in Visual Studio 2010

后端 未结 22 650
耶瑟儿~
耶瑟儿~ 2020-12-23 08:59

I am using Visual Studio 2010 in debug mode and I have \"optimize code\" unchecked. I can\'t quick watch (or hover on) any variable in the debugger. I get this error \"Canno

22条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-23 09:05

    I had the same problem. But in my case, the Debuggable attribute was hard coded in the AssemblyInfo.cs file of my project and therefor not (over-)written by compilation. It worked after removing the line specifying the Debuggable attribute.

提交回复
热议问题