hi Leo,
Thanks for adding the full Exception as it does shed some light on the issue. Below are traces of the two exceptions that are occurring. The exceptions occur after the ReceivedHttpResponse event is triggered. The exceptions occur in SkiaSharp after being called by ThinkGeo api’s.
Digging further into the Exception I also discovered the following:
TheEventArgsException.TargetSite.DeclaringType.AssemblyQualifiedName–>>
SkiaSharp.SKBitmap, SkiaSharp, Version=2.88.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
My application has SkiaSharp.dll V2.88.8 in the .\Debug\net8.0-windows directory. SkiaSharp is not specified as a Dependency in the project.
Does the issue revolve around SkiaSharp V2.88.0 vs V2.88.8?
Regards,
Dennis
2024-08-12 13:24:14,878 FINEST OriStarWmsClient - OriStarWmsClient->TheWmsProviderOriStar.TheWmsLayer_ReceivedHttpResponse:
Received HttpResponse
2024-08-12 13:25:00,991 ERROR OriStarWmsClient - OriStarWmsClient->TheWmsProviderOriStar.TheWmsLayer_RequestedImageException:
Unable to Draw WMS Layer for NearMap Due To:
Message=Object reference not set to an instance of an object.
Result=ThinkGeo.Core.GeoImage
Height=512, Width=512
Source=ThinkGeo.Core
TargetSite=Void MoveNext()
StackTrace= at ThinkGeo.Core.Async.WmsLayer.DownloadImageAsyncCore(Double width, Double height, Double scaleFactor, RectangleShape extent, GeographyUnit mapUnit, CancellationToken cancellationToken)
at ThinkGeo.Core.Async.WmsLayer.DrawAsyncCore(GeoCanvas canvas, Collection1 labelsInAllLayers) Message=Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at ThinkGeo.Core.Async.WmsLayer.DownloadImageAsyncCore(Double width, Double height, Double scaleFactor, RectangleShape extent, GeographyUnit mapUnit, CancellationToken cancellationToken) at ThinkGeo.Core.Async.WmsLayer.DrawAsyncCore(GeoCanvas canvas, Collection
1 labelsInAllLayers)
2024-08-12 13:25:01,009 ERROR OriStarWmsClient - OriStarWmsClient->TheWmsProviderOriStar.TheWmsLayer_RequestedImageException:
Unable to Draw WMS Layer for NearMap Due To:
Message=Value cannot be null. (Parameter ‘codec’)
Result=ThinkGeo.Core.GeoImage
Height=512, Width=512
Source=SkiaSharp
TargetSite=SkiaSharp.SKBitmap Decode(SkiaSharp.SKCodec)
StackTrace= at SkiaSharp.SKBitmap.Decode(SKCodec codec)
at SkiaSharp.SKBitmap.Decode(ReadOnlySpan1 buffer) at SkiaSharp.SKBitmap.Decode(Byte[] buffer) at GRU=.QRU=.QhU=(Byte[] bytes) at ThinkGeo.Core.GeoImage..ctor(Byte[] bytes) at ThinkGeo.Core.Async.WmsLayer.DrawAsyncCore(GeoCanvas canvas, Collection
1 labelsInAllLayers)
Message=Value cannot be null. (Parameter ‘codec’)
System.ArgumentNullException: Value cannot be null. (Parameter ‘codec’)
at SkiaSharp.SKBitmap.Decode(SKCodec codec)
at SkiaSharp.SKBitmap.Decode(ReadOnlySpan1 buffer) at SkiaSharp.SKBitmap.Decode(Byte[] buffer) at GRU=.QRU=.QhU=(Byte[] bytes) at ThinkGeo.Core.GeoImage..ctor(Byte[] bytes) at ThinkGeo.Core.Async.WmsLayer.DrawAsyncCore(GeoCanvas canvas, Collection
1 labelsInAllLayers)
2024-08-12 13:35:09,975 FINEST OriStarWmsClient - OriStarWmsClient->TheWmsProviderOriStar.TheWmsLayer_ReceivedHttpResponse:
Received HttpResponse
2024-08-12 13:35:09,977 ERROR OriStarWmsClient - OriStarWmsClient->TheWmsProviderOriStar.TheWmsLayer_RequestedImageException:
Unable to Draw WMS Layer for NearMap Due To:
Message=System.NullReferenceException: Object reference not set to an instance of an object.
at ThinkGeo.Core.Async.WmsLayer.DownloadImageAsyncCore(Double width, Double height, Double scaleFactor, RectangleShape extent, GeographyUnit mapUnit, CancellationToken cancellationToken)
at ThinkGeo.Core.Async.WmsLayer.DrawAsyncCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
Result=ThinkGeo.Core.GeoImage
Height=512, Width=512
Source=ThinkGeo.Core
TargetSite=Void MoveNext()
StackTrace= at ThinkGeo.Core.Async.WmsLayer.DownloadImageAsyncCore(Double width, Double height, Double scaleFactor, RectangleShape extent, GeographyUnit mapUnit, CancellationToken cancellationToken)
at ThinkGeo.Core.Async.WmsLayer.DrawAsyncCore(GeoCanvas canvas, Collection1 labelsInAllLayers) Message=Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at ThinkGeo.Core.Async.WmsLayer.DownloadImageAsyncCore(Double width, Double height, Double scaleFactor, RectangleShape extent, GeographyUnit mapUnit, CancellationToken cancellationToken) at ThinkGeo.Core.Async.WmsLayer.DrawAsyncCore(GeoCanvas canvas, Collection
1 labelsInAllLayers)
TheEventArgsException.Message–>>
Value cannot be null. (Parameter ‘codec’)
TheEventArgsException.TargetSite.DeclaringType.AssemblyQualifiedName–>>
SkiaSharp.SKBitmap, SkiaSharp, Version=2.88.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
TheEventArgsException.StackTrace–>>
at SkiaSharp.SKBitmap.Decode(SKCodec codec)
at SkiaSharp.SKBitmap.Decode(ReadOnlySpan`1 buffer)
at SkiaSharp.SKBitmap.Decode(Byte[] buffer)
at GRU=.QRU=.QhU=(Byte[] bytes)
at ThinkGeo.Core.GeoImage…ctor(Byte[] bytes)
at ThinkGeo.Core.Async.WmsLayer.G0E=.MoveNext()
TheEventArgsException.SerializationStackTraceString–>>
at SkiaSharp.SKBitmap.Decode(SKCodec codec)
at SkiaSharp.SKBitmap.Decode(ReadOnlySpan1 buffer) at SkiaSharp.SKBitmap.Decode(Byte[] buffer) at GRU=.QRU=.QhU=(Byte[] bytes) at ThinkGeo.Core.GeoImage..ctor(Byte[] bytes) at ThinkGeo.Core.Async.WmsLayer.DrawAsyncCore(GeoCanvas canvas, Collection
1 labelsInAllLayers)