“Cannot evaluate expression because the code of the current method is optimized” in Visual Studio 2010 November 13, 2022 by Tarik While the project was in debug mode, the solution was not. When I changed it, it worked.