Errors when debugging in Visual Studio


I seem to often get this error when debugging an EPiServer website:

Evaluating the function 'EPiServer.Core.BasicContent.DebuggerDisplay.get' timed out and needed to be aborted in an unsafe way. This may have corrupted the target process.

If the problem happens regularly, consider disabling the Tools->Options setting "Debugging->General->Enable property evaluation and other implicit function calls" or change the code to disable evaluation of this method. See help for information on doing this.

After this, the process is termitated.

The property timing out is not always the same, but I don't have this issue in other websites so far. 

Have anyone else experienced this, and maybe found a way to solve it?

Aug 08, 2018 10:44

I did experienced this. Shutdown Visual studio or Windows, start again would fix this.

Aug 13, 2018 13:28

You may experience this if you use IEnumerables<T> and Linq-queries in your code, especially when you have methods returning IEnumerable<T> types. As Linq-expressions are executed when data is accessed you may experience that specific error you're describing. I belive this may happen when one of your Linq-expressions throws an unhandled Exception while eveluating values in the debugger.

To avoid this you may return IList<T> from your methods instead of IEnumerable<T>. Also make sure that code contained in Linq-expressions does not throw Exceptions as they are difficult to catch.

Aug 28, 2018 13:02
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.