Exception while using GDAL in C#

后端 未结 8 513
囚心锁ツ
囚心锁ツ 2020-12-11 02:35

I started to use gdal_csharp dll in my application and read a geotiff file. but it says:

The type initializer for \'OSGeo.GDAL.GdalPINVOKE\'         


        
8条回答
  •  [愿得一人]
    2020-12-11 02:46

    As an update to this there is now GDAL maintained by the SharpMap team as a nuget package here which is updated regularly. You'll need to install both the "GDAL.Native" and "GDAL" package for your project to use the GDAL library. Once installed via nuget, they'll automatically create a "GdalConfiguration.cs" that you call into to initialize the GDAL paths before starting. The only thing to note is the packages are setup to automatically copy their appropriate GDAL libraries to your output build directory. If you need to deploy the application you'll have to do a bit of extra effort.

提交回复
热议问题