Description:I have noticed that from last few days I am started getting "Cannot evaluate expression because the code of the current method is optimized" error in my visual studiio 2017 project , I have no idea is there any visual studio setting that is needed to be updated or it is due to my project implementation ?
Posted by: Khalid Abbas | Posted on: May 30, 2019
5
1
Replied by: K W | Replied on: Dec 12, 2019
First of all one thing is for sure that this error's nothing to do with Visual studio Version , now there are few things which you need to check to resolve this error as follows.
1)Make sure your project and solution are running in debug mode.
2)Make sure you have unchecked the Optimize Code property under project properties. Project (right Click)--> Properties --> Build (tab) --> uncheck Optimize code
3)Make sure you have enabled Use managed compatibility mode option. by going to : Tools --> Options --> Debugging --> General -->Use managed compatibility mode
4)Once Clean and rebuilt your solution.
Replied by: Peter Andre | Replied on: May 30, 2019