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
It sounds like you are debugging an optimised / release build, despite having the optimised box un-checked. Things you can try are:
If you cant't see the Modules menu item in the Debug -> Windows menu then you may need to add it in the "Customise..." menu.
Try to run in debug mode.If you are running in release mode you will get this message.
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.
I had the same problem in VS2008. In my case it was solved via solution-rebuild.
In Visual Studio 2012 enabling the "Managed" option from Tools > Debugging > Just-In-Time worked for me.
Apart from @Kragen mentioned, If you are debugging a web project
close the visual studio and try deleting the temporary files at C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files