Exception not caught

I have a 64-bit system with Win7, and I am using VS2010 with .Net Framework 4.0.

In a Winform application, I get an exception from a third-party component, I try to catch this exception with Try-Catch, but it does not work!

Why?

enter image description here

UPDATE

If I don’t check the CLR exceptions, it works correctly, but I have to check it because of this known problem: Why cannot loading the form catch the exception?

If I press F10, he will continue to enter the statement!

+4
source share
2 answers

It seems you are using an unmanaged dll call here. Try to catch this exception using the ExternalException Class . This may work for you, but once you go beyond the .NET runtime, it depends entirely on unmanaged code; nothing can be done there by the .NET runtime.

+1
source

You have the following settings: checkbox:

Break when exceptions intersect with AppDomain domains or managed / native (managed only)

on the Tools-> Options-> Debugging-> General tab for Visual Studio 2010

This is explained in MSDN here

0
source

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


All Articles