Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Evaluating the function 'function' timed out

Environment: Visual Studio 2017 version 15.5.2

Error:

Evaluating the function 'function' ("Windows.Controls...ToString" in my case) timed out and needed to be aborted in an unsafe way.

Answers say this commonly occurs when

Options > Debugging > General > enable property evaluation > is enabled.

I disabled this. Problem still happens. Microsoft presents a few options to solve this including

  • Prevent the debugger from calling the getter property or ToString method (In my case this is 3rd party code)
  • Have the target code ask the debugger to abort the evaluation (I don't know what this means. It strikes me as "just ignore it")
like image 708
P.Brian.Mackey Avatar asked Feb 20 '18 17:02

P.Brian.Mackey


2 Answers

I found this was related to ReSharper. Unchecking Debugger Integration from the ReSharper options solved the issue for me:

VS2017 > ReSharper > Options > Products & Features > Uncheck Debugger Integration

enter image description here

like image 108
Jeff Widmer Avatar answered Sep 22 '22 14:09

Jeff Widmer


This popped up for me in Visual Studio 2017. Version 15.5.2. I stopped the error with an option in the top menu:

Debug > Options > "Use Managed Compatibility Mode"

This is not ideal. From the docs "Use Managed Compatability Mode":

Replaces the default debugging engine with a legacy version to enable these scenarios:

You are using a .NET Framework language other than C#, VB, or F# that provides its own Expression Evaluator (this includes C++/CLI).

You want to enable Edit and Continue for C++ projects while mixed mode debugging.

Note that choosing Managed Compatibility mode disables some features that are implemented only in the default debugging engine.

I hope to see a better fix soon. As of 2/20/2018 there is a similar/same open issue in the Microsoft Developer Community.

UPDATE

This bug is listed as closed/fixed as of 5/22/2020.

like image 30
P.Brian.Mackey Avatar answered Sep 20 '22 14:09

P.Brian.Mackey