Catching PINVOKE exception from loaded assembly

Thank you for both the solution and detailed explanation Menno. That worked perfectly!
It is interesting that once I copied all the .dlls from the “bin” folder, an exception remained. I had to restart Rhino 5, before the exception went away.

Greetings to the lovely Netherlands.