When debugging/stepping through code, and I try to examine a variable in the watch, I get errors for every inner-variable stating function evaluation timed out.
Does
The most likely cause of this problem is an implicit evaluation of a property or ToString
method which causes an issue with the CLR evaluation thread. To verify this turn off implicit evaluation.
Then restart your scenario and see if it works.
Visual studio executes the property getter to get its value, if it takes a long time either because its doing something expensive you get this error. consider:
public class foo
{
private object lockObject = new object();
public int bar
{
get
{
lock(lockObject){
return 42;
}
}
}
public int aMethod()
{
lock(lockObject)
{
var a = this.bar;
return a*2; //insert a break point here
}
}
}
If you add a break point on the return statement in aMethod the debugger will not be able to evaluate the bar property, because doing so requires that it acquires the lock object, but it won't be able to do so because the program will hold that lock forever while the break point is active