There is a third-party library on the pros that takes the log from the device (a fingerprint scanner) and gives it to the managed code. The library periodically asks the device which users are loaded onto it and which are not loaded there by the user with fingerprints. The period of 1 hour. Parameters are passed correct.
The problem is in the occurrence of an error at an unpredictable point in time when the C ++ library crashes. More specifically, when trying to pick up the list of users downloaded to the device, even when the list of users and fingerprints has not changed.
I tried to add the attributes HandleCorruptState and catch AccessViolation, Win32Exception, ExternalException, Exception, individually and all taken together and nothing, the process just drops.
Version .NET 4.6.1.
PS I caught AccessViolation in the first place, because with the wrong parameters passed to the positive lib, she threw this exception. The output to the log when UnhandledException also exists and the logs are empty.
QUESTION: How to solve this problem? Either catch an exception, or somehow isolate the workspace so that it can be reloaded.
extern C- NewView