18

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.

  1. How can I stop showing it?
  2. What is it trying to tell me anyway?

enter image description here

2

3 Answers 3

13

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/

2
  • Why does this message appear intermittently, and in some solutions not at all?
    – Hugh W
    Commented Mar 12, 2023 at 13:00
  • I'm not sure the article you referenced is talking about the same thing, at least not exactly. The message in the question seems to be saying 'there was a reason to stop ("unsafe abort") but we didn't'.
    – Hugh W
    Commented Mar 12, 2023 at 13:04
6

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.

4

For Visual Studio 2022 Untick the option below: Tools > options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.