Probably, one of the main questions that remain is how exactly the handling / display of exceptions from C ++ CLI code in C # code is done.
After all, the C ++ CLI combines managed and unmanaged code, and in addition is called from managed C # code.
How to correctly handle exceptions of C ++ CLI code on the C # side:
<exception>not placed in the managed part of CLI code?
<exception>are placed in the managed part of CLI code? Forward on?
If on the side of the unmanaged code
AcсessViolationknocks out, and in the managed part of the CLI this method is in the
try\catch– will the application crash all the same?
Throwing exceptions between libraries and languages should be avoided.
The reason is that C ++ does not have a fixed ABI, even different versions of the compiler can implement these things in different ways inside.
If you want reliable and portable code, localize exceptions within a single binary.