The code
A = NET.addAssembly('C:\path\to\mydll.dll')
fails with the hint 'source: mscorlib'.
After some searching, I tried to capture the exception using
try NET.addAssembly('C:\path\to\mydll.dll')catch exend
But the ex.ExceptionObject has no field LoaderException:
>>> ex.ExceptionObject.LoaderExceptions.Get(0).Message No appropriate method, property, or field 'LoaderExceptions' for class 'System.IO.FileLoadException'.
How can I get access to the LoaderException?
//EDIT: I pinned it down: mydll.dll depends on a version of hdf5.dll which is situated in the same folder as mydll.dll. If I comment out all statements relying on hdf5.dll from the source of mydll.dll, the import works. Could it be that MATLAB is working with another version of hdf5.dll it found somewhere else? I tried 1) adding the folder with my version to the path 2) copying hdf5.dll to /system32.
Best Answer