Rhino crashes on native call

A few things come to mind: how do you initialise the data that goes into the native call? Looking at the example given here there is quite some initialisation required prior to the first call to PARDISO.

Also, be aware that in debug mode, usually all variables are initialised to their default values, whereas in release mode, they are not.

Lastly, you may need to change your calling convention, the use of [In] and [Out] parameters or play with MarshalAs(...) to get this right. Typically, what I do in these cases is make my own native DLL that makes the call to the native library (in your case MKL). Then I P/Invoke to my own DLL. The advantage is that when you enable “support native debugging” for the C# project, you can step into your own DLL and inspect the state of all variables prior to calling into MKL. This may help you to pinpoint the problem.