Friday, December 5, 2008

"Cannot evaluate expression because the code of the current method is optimized"

While trying to debug, came across this error on items on the watch list: "Cannot evaluate expression because the code of the current method is optimized". Non of the parameters can be 'watched'.

Steps to resolve:
1. Check if the code is really optimized on Project Properties. Also check if debug mode is 'Release'. If those checks are done and still get the same message, go to step 2.
2. Check the config mgr (drop down on the menu somewhere in the center). make sure it says 'debug' and not 'release'.