ThinkGeo.com    |     Documentation    |     Premium Support

ThinkGeo.Dependency.Gdal version problems

Hi,

A bit related to this SkiaSharp version problem we have stopped adding packages starting with ThinkGeo.Dependency and are using the latest prerelease versions that were available on May 19th.

However, now we are observing an issue with ThinkGeo.Dependency.Gdal. We end up getting 12.4.0 even many of the packages (i.e. ThinkGeo.Gdal and ThinkGeo.UnmanagedProj) depend on >= 13.0.0.

This is what we see when using the UnmanagedProjectionConverter:

System.TypeInitializationException: The type initializer for ‘ThinkGeo.Core.UnmanagedProjectionConverter’ threw an 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 DLL ‘gdal_wrap’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Gdal(ExceptionDelegate applicationDelegate ExceptionDelegate arithmeticDelegate ExceptionDelegate divideByZeroDelegate ExceptionDelegate indexOutOfRangeDelegate ExceptionDelegate invalidCastDelegate ExceptionDelegate invalidOperationDelegate ExceptionDelegate ioDelegate ExceptionDelegate nullReferenceDelegate ExceptionDelegate outOfMemoryDelegate ExceptionDelegate overflowDelegate ExceptionDelegate systemExceptionDelegate)
at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper…cctor()
— End of inner exception stack trace —
at OSGeo.GDAL.GdalPINVOKE.SWIGExceptionHelper…ctor()
at OSGeo.GDAL.GdalPINVOKE…cctor()
— End of inner exception stack trace —
at OSGeo.GDAL.GdalPINVOKE.SetConfigOption(String jarg1 String jarg2)
at OSGeo.GDAL.Gdal.SetConfigOption(String pszKey String pszValue)
at ThinkGeo.Core.GdalConfiguration…cctor()
— End of inner exception stack trace —
at ThinkGeo.Core.GdalConfiguration.ConfigureGdal()
at ThinkGeo.Core.UnmanagedProjectionConverter…cctor()
— End of inner exception stack trace —
at ThinkGeo.Core.UnmanagedProjectionConverter…ctor(String internalProj String externalProj)

Should we still manually refer to ThinkGeo.Dependency.Gdal to achieve a working combination of package versions or is there some dependency issue in the ThinkGeo packages themselves that might get fixed?

Best Regards,
Jarno

Hi Jarno,

Yes, I think you’ll still need to reference the Gdal dependency for 13.0.1 from here:
https://www.nuget.org/packages/ThinkGeo.Dependency.Gdal/13.0.1

Also try removing the /bin and /obj folders, restart Visual Studio and then restore the packages and I think you’ll be good to go.

Thanks,
John

Hi John,

Thanks for clearing that out. Actually we now found out that we also had an issue with our build pipe not including all the native runtimes in the installer. Got fixed well enough when that got resolved, even with the Dependency.Gdal 12.4.0.

So apologies for the partly unnecessary post.

Regards,
Jarno

Thanks Jarno,

Glad to hear it’s all working. Let us know if anything else comes up.

Thanks,
John