Hello to IronPython community,

I am trying call a method from loaded .NET assembly in python, but for some 
reason, I am getting a PINVOKE exception. Is there some way to print what is 
the reason for that exception?
This is the code:
import clr
clr.AddReferenceToFileAndPath("c:/gdal/gdal2bb/gdal_csharp.dll")

import OSGeo.GDAL as gdalc

gdalc.Gdal.AllRegister()


The last line raises:

The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception.


I am essentially trying to open the file by replicating this c++ example.

What is the reason for the raised PINVOKE exception?

I have a 32 bit windows XP SP3 operating system and loaded gdal_csharp.dll is 
32 bit compiled, download​ed from gisinternals.com. I attached gdal_csharp.dll 
and all other its .dlls in here. I am using IronPython 2.7, which is what Rhino 
5 application is shipped with (basically, I am using IronPython 2.7 interpreter 
inside Rhino 5 application).
This is the gdal documentation page.

I tried looking for an answer at Gdal's mailing list too, but without success.

Any help would be appreciated.

Thank you in advance,

Kind regards,
Djordje Spasic

_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
https://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to