Evaluating the function 'function' timed out
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.
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