I am facing an issue with Visual Studio 2019 (version 16.3.8), when starting an ASP.NET Core 3 WebApi project.
After clicking OK the project starts and runs without any issue. However the pop-up keeps nagging me every time I start my solution.
There seems to be two possible solutions to this, that at least worked for me being on Visual Studio 2019.
Solution
Goto Tools => Options => Debugging => General
and then either enable Use Managed Compatibility Mode
(thanks to Nan Yu) or disable Enable property evaluation and other implicit function calls
.
The second solution faces the drawback that when being in break mode, we have to manually hit refresh on the locals window to see a variables content.
Background
The message is telling us, that our system state may get changed when being in break mode due to implicit property evalution.
By default, we tell Visual Studio debugger to try and evaluate properties implicitly. This of course requires running code while we are braked, and not only display memory content. Running code, might potentially change the state of the system, which is not always what we want. For example, I might be increasing a counter every time the property is accessed, which means that when the debugger will try to evaluate the property, my code will run, the counter will be incremented, and my system state is changed, even though I am braked.
https://blogs.msdn.microsoft.com/eliofek/2012/12/12/why-do-we-get-the-function-evaluation-requires-all-threads-to-run/
I had some variables in my watch window that was causing this error popup to happen. Just remove them from your watch window and the error popup should no longer display.
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