ThinkGeo.com    |     Documentation    |     Premium Support

Cannot upgrade SkiaSharp to latest "SkiaSharp.SKData"

Hi, following a suggestion from you on this forum I have tried upgrading the dependency SkiaSharp to the latest version (3.116.1) as the current version seems to have a bug related to adding a jpeg to a ThinkGeo map.
So my current ThinkGeo Version is 14.2.5 and I have SkiaSharpp, SkiaSharp.NativeAssets.Linux / maxOs / Win32 at 3.116.1

This required me to do an assembly binding redirect as ThinkGeo Core throws an exception otherwise.

	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<dependentAssembly>
				<assemblyIdentity name="SkiaSharp" publicKeyToken="0738eb9f132ed756" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-3.116.0.0" newVersion="3.116.0.0" />
			</dependentAssembly>
		</assemblyBinding>
	</runtime>

After doing that however, I still cannot start the Map as I get following Error:

Exception thrown: 'System.TypeInitializationException' in SkiaSharp.dll
The type initializer for "SkiaSharp.SKData" threw an exception.
at SkiaSharp.SKData.Create(IntPtr address, Int32 length)
at SkiaSharp.SKBitmap.Decode(ReadOnlySpan`1 buffer) in / <em>/binding/SkiaSharp/SKBitmap.cs:line 573.
at SkiaSharp.SKBitmap.Decode(Byte[] buffer) in /</em> /binding/SkiaSharp/SKBitmap.cs:line 566.
at ThinkGeo.Core.EditInteractiveOverlay.e0U=()
at ThinkGeo.Core.EditInteractiveOverlay..ctor(Boolean designMode)
at ThinkGeo.Core.MapViewBase.HUQ=(Boolean designMode)
at ThinkGeo.Core.MapViewBase..ctor(Boolean designMode)
at ThinkGeo.UI.Wpf.MapView..ctor()

Inner Exception: Unable to load library ‘libSkiaSharp’.

Do you have any idea to proceed with this issue? The .dll is found, there is no binding error thrown in the fusion log etc.

Hi Julian,

It has been upgraded to the latest SkiaSharp 3.116.1 in beta105, and this will be applied to the next main release v14.3 by May. Can you use the latest beta for now and upgrade to v14.3 later?

Thanks,
Ben

Hi Ben, thank you, this works for us!

Julian, that’s great! :+1: