Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Function evaluation disabled because a previous function evaluation timed out." - in vs2012

Recently I started working on VS2012.

When I debug my code (this is a SharePoint 2013 application) and trying to get the value of variables - I get again and again the message:

Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation. 

I previously worked in visual studio 2010 (for SharePoint 2010 applications) and almost never got this message while trying to get the value of variables in the Quick Watch.

I Googled the error message, and I saw that the problem occurs when trying to get a value of functions whose action takes a long time, But I'm not trying to get a value of functions, only variables, and yet I get this error.

I do not always get the error on the same variables, but random - each time different variables.

Is anyone else having this problem specifically in VS2012?

And how can I get rid of it?

like image 733
banana Avatar asked Jul 21 '13 13:07

banana


1 Answers

Why this is happening ?

It seems this kind of bug can happen simply when you are trying to watch at some variables who have to be thread safe but sometimes this framework implementation is not perfect....

To avoid this problem : when stepping through code where variables are bound to windows or other controls, you don't show local variables or "auto" variables. Look at such things only when you are sure your variables are all safe to look at. And note that the error doesn't necessarily appear on the unsafe variables. Use the "immediate" window on safe (i.e. non-control) variables when operating in dangerous code.

Data accessors should always be thread safe. But sometimes between two implementations (let's say between Sharepoint 2010 and Sharepoint 2012 or two version of the .NET framework), this rules is sometimes not true... There is some examples between VS2003 and 2005...

How can I increase the timeout ?

You can increase the timeout by changing the values of the registry Key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Debugger using RegEdit.

Don't forget to restart Visual Studio after changing the registry key.

like image 106
Pierre Fourgeaud Avatar answered Oct 03 '22 17:10

Pierre Fourgeaud