简体   繁体   中英

How to disable the Debugger From Breaking On A Task Exception In VS2019?

Whenever I try to utilize Tasks That Throw Exceptions, usually in the cases of cancelling tasks, the debugger will always break on the exception inside the task delegate not letting me continue without totally removing the exception all together(Even if I wrap a cancelled task inside a try/catch the debugger will still throw on the Cancellation method as it throws an exception). Is there any way to disable this feature as I have to constantly run my programs without a debugger to avoid this feature?

Picture Of Problem: 调试器中断应忽略的异常

More Info: I am using C# .net core 3.1, vs2019 16.7.2 Community Edition

Two ways, if you are already debugging:

  1. Click the arrow to the left of the exception settings
  2. un-check "Break when this exception type is user-unhandled".

If you want to add a global exception to visual studio 2019

Go to Debug > Exceptions dialog, click Add, select Common Language Runtime exceptions, and enter the full name (not the assembly-qualified name) of the exception. Then uncheck the Thrown checkbox for this exception.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM