I’m facing the following error when attempting to open a KMLFeatureLayer in our Linux service layer:
> Unhandled exception. System.TypeInitializationException: The type initializer for ‘ThinkGeo.Core.GdalConfiguration’ threw an exception. ││ —> System.TypeInitializationException: The type initializer for ‘OSGeo.GDAL.GdalPINVOKE’ threw an exception. ││ —> System.TypeInitializationException: The type initializer for ‘SWIGExceptionHelper’ threw an exception. ││ —> System.DllNotFoundException: Unable to load shared library ‘gdal_wrap’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libg ││ at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Gdal(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, Exc ││ at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper…cctor()
My issue is very similar to the following ThinkGeo post:
ThinkGeo.Dependency.Gdal version problems
The project builds, runs, and handles KML files when running locally under Windows.
Here is a list of the ThinkGeo packages I’m using:
<PackageReference Include="ThinkGeo.Core" Version="13.1.0" />
<PackageReference Include="ThinkGeo.Dependency.Gdal" Version="13.0.1" />
<PackageReference Include="ThinkGeo.Dependency.MicrosoftVisualCRunTime140" Version="13.0.0" />
<PackageReference Include="ThinkGeo.Gdal" Version="13.1.0" />
<PackageReference Include="ThinkGeo.Kml" Version="13.1.0" />
<PackageReference Include="ThinkGeo.UI.WebApi" Version="13.1.0" />
<PackageReference Include="ThinkGeo.UnmanagedProj" Version="13.1.0" />
I’ve also included the ThinkGeo.Dependency.Gdal in my API project per the previously referenced post.
I’ve also added the undocumented call needed for setting up the Gdal before using it:
GdalConfiguration.ConfigureGdal();
However, the included packages do not properly install the .so files utilized in the Linux containers.
Why does the dependency package not include the required Linux files?
Thank you for your help,
Jason