I am encountering this problem [see title] when debugging a unit test in Visual Studio 2010.
In the Locals menu, the error: "The value of the local or argument 'x' is unobtainable at 开发者_开发百科this time." appears in the Value column of all my List<T
> variables.
Both my unit test project and the project being tested have the "build output debug info" attribute set to full.
How do I "watch" these variables?
Try changing the project's target framework. I got the error with a .net4 project referencing a .net3.5 project. Changing the .net4 to .net3.5 got rid of the message.
Since it is a local variable, the error probably means that you are not actually debugging that particular method at that time. Hence the debugger can't see the varaible.
I'm gonna guess that you created some object (apparently a List<>) as a local varaible to your unit test method, and then called the method you actually want to test. As you step through that method, you want to see the local variable.
Presumably, you've passed it to the method under test as a parameter. If so, watch the parameter. If not, then you can't affect that varaiable, so you can assume it hasn't changed.
Twas due to a System.OutOfMemoryException in Visual Studio.
精彩评论