I updated Visual Studio 2017 to version 15.8.2.
After this update, I started to encounter these errors while debugging:
Here are the error messages:
Visual Studio Debug Error: To prevent an unsafe abort when evaluating the function *.toString all threads were allowed to run. This may have changed the state of the process and any breakpoints encountered have been skipped.
This error shows up quite often, and after a while Visual Studio crashes.
I tried to uninstall and install Visual Studio again and reset preferences, but I had no luck.
When I disable the option: "Enable property evaluation and other implicit function calls", I get the same error when I try to evaluate some properties by moving the mouse over them. It's quite difficult to debug without it, and I had no problems before this build.
The problem is the same with C# and Visual Basic (.NET).
Is there any fix for this problem? My team has no problem working on the same project with Visual Studio 2017 version 15.7.4
To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.
Use Managed Compatibility Mode: Replaces the default debugging engine with a legacy version to enable these scenarios: You are using a . NET language other than C#, Visual Basic, or F# that provides its own Expression Evaluator (this includes C++/CLI).
I add the same error message but with a different function name :
To prevent an unsafe abort when evaluating the function 'Microsoft.VisualStudio.Debugger.Runtime.Tracing.Refresh' all threads were allowed to run. This may have changed the state of the process and any breakpoints encountered have been skipped.
This is how I got rid of this pesky bug :
In Visual Studio 2017 go to
Tools → Options → Debugging → General → Check 'Use Managed Compatibility Mode'
thanks to this article :
https://www.codeart.dk/blog/2018/9/vs2017-debugger-timeout/
Visual Studio 2017 Debug Error: To prevent an unsafe abort when evaluating the function *.toString all threads where allowed to run
According to this document:
One common reason for this problem is that when the debugger evaluates a property, it only allows the thread being inspected to execute. So if the property is waiting on other threads to run inside the debugged application, and if it is waiting in a way that the .NET Runtime isn't able to interrupt, this problem will happen.
And to resolve this issue, you can try following two possible solutions:
Besides, if above not resolve that error, you can also install the previous old version Visual Studio to check if it works for you:
https://docs.microsoft.com/en-us/visualstudio/productinfo/installing-an-earlier-release-of-vs2017#top
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With