When debugging unit tests in Visual Studio 2010 SP1 with NUnit 2.5.开发者_开发知识库7 I often get this error evaluating an expression in the immediate window:
Cannot evaluate expression because debugging information has been optimized away
Often this happens when I test a few expressions and then all of a sudden I get this error. When the error occurs, the locals window empties out and the next attempt to step into a line effectively runs the code to the end--no more debugging.
I've seen something similar in ASP.NET related to the worker process not responding to ping requests since it was being debugged, but in my situation I'm running a local application, not a web application.
I'm running the tests through ReSharper 5.1.3. The code is all being built for for the "Debug" configuration against the .NET 4 framework.
This happens most of the time I run the debugger since upgrading from VS2008 to VS2010 yesterday.
精彩评论