Open chaibi-mustapha opened 6 days ago
This is the same crash as when updating to WinUI 1.6.0 (#2999). It seems like the latest version of VS (17.11.5) updates the version of CsWinRT to 2.1.2. And from what I've seen, the issue is related to changes made in CsWinRT v2.1.1.
Btw, this is also occurring in Windows based .Net Maui apps that use skia sharp. Updated Visual Studio and therefore also the windows sdk and my app started to crash but only in Windows (Android is ok).
Created a brand new Maui project and ran it from the default code that counts button clicks. Added SkiaSharp (remembering to add the UsesSkiaSharp call to MauiProgram.cs) and adding the SkCanvasView to the mainpage.xaml introduces the crash:
<skia:SKCanvasView x:Name="skCanvasView" WidthRequest="30" HeightRequest="50" BackgroundColor="Red" />
Tried the 2.88.8 SkiaSharp.Views.Maui.Controls package and also 3.0.0-preview.4.1 but same result from each
I have the same issue. From my point of view the only change between a working version and a crashing version is the switch from .Net SDK 8.0.402 to 8.0.403. It now crashes locally and with the version build in a Github Action. The only difference in the pipeline is the switch in the SDK-version. Don't know if this is really related, though. My app silently crashes without any exception if the SkXamlCanvas
comes into view (this is an Uno app).
Update: The SDK-version does not seem to make a difference. I'm still investigating.
This seems to be the StackTrace:
bei System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
bei System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
bei WinRT.IWinRTObject.<IsInterfaceImplementedFallback>g__GetObjectReferenceViaVftbl|1_1(IObjectReference objRef, Type vftblType) in WinRT\IWinRTObject.cs: Zeile204
bei WinRT.IWinRTObject.IsInterfaceImplementedFallback(RuntimeTypeHandle interfaceType, Boolean throwIfNotImplemented) in WinRT\IWinRTObject.cs: Zeile192
bei WinRT.IWinRTObject.System.Runtime.InteropServices.IDynamicInterfaceCastable.IsInterfaceImplemented(RuntimeTypeHandle interfaceType, Boolean throwIfNotImplemented) in WinRT\IWinRTObject.cs: Zeile30
bei WinRT.CastExtensions.As[TInterface](Object value) in WinRT\CastExtensions.cs: Zeile17
bei SkiaSharp.Views.Windows.Utils.GetByteBuffer(IBuffer buffer)
bei SkiaSharp.Views.Windows.WindowsExtensions.GetPixels(WriteableBitmap bitmap)
bei SkiaSharp.Views.Windows.SKXamlCanvas.CreateBitmap(SKSizeI& unscaledSize, Single& dpi)
bei SkiaSharp.Views.Windows.SKXamlCanvas.DoInvalidate()
bei ABI.Microsoft.UI.Dispatching.DispatcherQueueHandler.Do_Abi_Invoke(IntPtr thisPtr) in ABI.Microsoft.UI.Dispatching\DispatcherQueueHandler.cs: Zeile123
bei WinRT.ObjectReference`1.GetVtable(IntPtr thisPtr) in WinRT\ObjectReference.cs: Zeile130
bei WinRT.ObjectReference`1..ctor(IntPtr thisPtr) in WinRT\ObjectReference.cs: Zeile31
bei WinRT.ObjectReference`1.Attach(IntPtr& thisPtr, Guid iid) in WinRT\ObjectReference.cs: Zeile67
bei WinRT.ObjectReference`1.TryAs(IObjectReference sourceRef, Guid iid, ObjectReference`1& objRef) in WinRT\ObjectReference.cs: Zeile155
bei WinRT.IObjectReference.TryAs[T](Guid iid, ObjectReference`1& objRef) in WinRT\IObjectReference.cs: Zeile179
bei WinRT.IObjectReference.As[T](Guid iid) in WinRT\IObjectReference.cs: Zeile140
bei WinRT.IObjectReference.As[T]() in WinRT\IObjectReference.cs: Zeile134
bei System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
bei System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Hope that helps :)
3.0.0-preview-5.3 from package source https://pkgs.dev.azure.com/xamarin/public/_packaging/SkiaSharp/nuget/v3/index.json stopped the crashes for me in my test app so I have temporarily done the same in the app I'm developing until 3.0.0 is formally released (hopefully before my deadline!!).
Yes, just found out - this is the correct issue: https://github.com/mono/SkiaSharp/issues/2999
Description
a debugger is attached but not configured to debug this exception
Code
Code C# :
Expected Behavior
No response
Actual Behavior
No response
Version of SkiaSharp
2.88.8 (Current)
Last Known Good Version of SkiaSharp
2.88.7 (Previous)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
No response
Devices
No response
Relevant Screenshots
Relevant Log Output
No response
Code of Conduct