ThinkGeo.com    |     Documentation    |     Premium Support

InvalidOperationException on Startup

Greetings,

When one of our users tried running our app on their Win10 machine, it failed at startup. Looks like a SkiaSharp failure, but there’s nothing different from the app this user installed vs others also using Win10 machines. Any ideas on what target machine differences could cause this?

System.InvalidOperationException
at SkiaSharp.SkiaSharpVersion.CheckNativeLibraryCompatible(System.Version, System,Version, Boolean)
at SkiaSharp.SkiaSharpVersion.CheckNativeLibraryCompatible(Boolean)
at SKiaSharp.SKOBject…cctor()

System.TypeInitializationException
at SkiaSharp.SKOBject…ctor(IntPtr, Boolean)
at SkiaSharp.SKDaata…ctor(IntPrt, Boolean)
at SkiaSharp.SKData+SKDataStatic…ctor(IntPtr)
at SkiaSharp.SKData…cctor()

Exception Info System.TypeInitializationException
at SkiaSharp.SKData.Create(IntPtr, Int32)
at SkiaSharp.SKBitmap.Decode(System.ReadOnlySpan`1)
at SKiaSharp.SKBitmap.Decode(Byte[])
at ThinkGeo.Core.EditInteractiveOverlay.1ks=()
at ThinkGeo.Core.EditInteractiveOverlay…ctor(Boolean)
at ThinkGeo.Core>MapViewBase.eUo=(Boolean)
at ThinkGeo.Core>MapViewBase…ctor(Boolean)
at ThinkGEo.UI.Wpf.MapView…ctor()

Thanks Fred,
Could you check the version for the windows 10. Some machine may running windows 32bit. If so you may need compile the application with x86 option. This is one thing I can think about.

Thanks

Frank

It’s compiled with AnyCPU right now, which I thought would cover this scenario. Will check with the user.

Thanks Fred,
Go ahead let us know if you have any feedback.

Thanks

Frank

Both the user’s machine and mine (which has no issue) are Windows 10 (64-bit OS) and x64-based processors, so that’s not the cause.

Thanks Fred,
Good to know it works. Go ahead let us know if you have more questions.

Thanks

Frank

It doesn’t work - what I’m saying it’s that both the user and I are running Win10 64-bit OS, x64 processor machines, and the user is still getting that startup crash.

Thanks Fred,
Sorry for misunderstand.

There is one thing we could try.
https://wiki.thinkgeo.com/wiki/thinkgeo_runtime_license_guide_for_desktop
The last line of the page make sure the target machine installed the dependencies.

Another possible reason. This machine may have installed a different version of SkiaSharp library. I will talk this with developer team see if they have any idea.

Thanks

Frank

Most recent VC++ Redistributables installed, still the same error

Thanks Fred,
I talked with developers. We found you may still doing development with mapsuite 12.2.x. 3 months ago, We have released the 12.3.x which upgrade the SkiaSharp from 1.6 to 2.8. So could you upgrade the mapsuite package to the latest one by NuGet and try run the app on the customer machine again.

Thanks

Frank

We already are working in 12.3.x. The libraries currently being used are:

ThinkGeo.Core 12.3.1
ThinkGeo.Gdal 12.3.1
ThinkGeo.Ui.Wpf 12.3.1
ThinkGeo.UnmanagedProj 12.3.1
ThinkGeo.NauticalCharts 12.3.1
ThinkGeo.Printers 12.3.1

Will upgrade to 12.3.2 and try again.

Thanks Fred,
It is very strange this only happen for one client but others works fine. Does this client machine install some other GIS or Drawing software? I think maybe some of these software installed a different version of SkiaSharp library.

Thanks

Frank

Will have a better answer for you tomorrow when the client is back in office

Thanks Fred.

Go ahead let us know if you have any feedback.

Thanks

Frank

I’m able to get startup errors when trying from a vanilla Win10 Pro VM, but they’re tied to GDAL failing.

With a AnyCPU target build:

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.BadImageFormatException
at OSGeo.GDAL.GdalPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Gdal(ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate)
at OSGeo.GDAL.GdalPINVOKE+SWIGExceptionHelper…cctor()

With a x86 target build:

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DllNotFoundException
at OSGeo.GDAL.GdalPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_Gdal(ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate, ExceptionDelegate)
at OSGeo.GDAL.GdalPINVOKE+SWIGExceptionHelper…cctor()

Thanks Fred,
Looks like this is a different issue. We could schedule a screen share meeting to look into both these two issue. I sent you the schdule meeting link by the support ticket.

Thanks

Frank