Visual Studio application completes Exception

I have some places in a C # application where a potential exception is not found, but there is a try-finally block to free resources before the failure in case of an exception.

When I run the code in Visual Studio and an Exception occurs, it breaks into a correlation line, marks it yellow and describes the exception.

It's good.

But, having noticed and read the exception, I want my application to fail (execute finally blocks). This is exactly what will happen if I run the code outside of Visual Studio. However, when I press F5 to continue, it gets stuck on this very line, marking it again and again.

What can I do to tell Visual Studio I want the application to continue = crash?

+3
source share
3 answers

What happens, you see the Excception Assistant function for Visual Studio. Whenever there is an unhandled exception in the user code, it will be displayed to inform the user about the problem.

Unfortunately, in certain circumstances he cannot be forced to leave, and you will get the behavior that you describe. It is definitely very difficult when this happens. The best way around this is to disable the exception helper.

  • Tools → Options
  • Debugging → Generale
  • Uncheck "Enable exception helper"
+5
source

, F5. , , , , , try , . VS, , , . , . F5 .

+1

Visual studio , catch .

, "" > "" , .

0

Source: https://habr.com/ru/post/1767197/


All Articles