Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Uno WASM] InvalidOperationException in Uno SKSwapChainPanel.OnDpiChanged #1878

Open
nor0x opened this issue Dec 2, 2021 · 1 comment

Comments

@nor0x
Copy link

nor0x commented Dec 2, 2021

Description
i have created a blank new Uno WebAssembly project added the latest SkiaSharp packages and added a SKSwapChainPanel to the UI. When i run the application it crashes with the following error about Windows.UI.Core.UIAsyncOperation at SKSwapChainPanel.OnDpiChanged

VM149:1 
        
      fail: Uno.UI.Dispatching.CoreDispatcher[0]
      Dispatcher unhandled exception
System.InvalidOperationException: Failed to load App2.MainPage: System.TypeLoadException: Could not resolve type with token 0100005f from typeref (expected class 'Windows.UI.Core.UIAsyncOperation' in assembly 'Uno, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null')
   at SkiaSharp.Views.UWP.SKSwapChainPanel.OnDpiChanged(DisplayInformation sender, Object args) in D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno\SKSwapChainPanel.cs:line 103
   at SkiaSharp.Views.UWP.SKSwapChainPanel.Initialize() in D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno\SKSwapChainPanel.cs:line 36
   at SkiaSharp.Views.UWP.SKSwapChainPanel..ctor() in D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.Wasm\SKSwapChainPanel.Wasm.cs:line 32
   at App2.MainPage.InitializeComponent() in C:\unotest\App2\App2\App2.Wasm\Uno.UI.SourceGenerators\Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator\MainPage_f75f1605df50209eee8b52c1d92b226f.cs:line 59
   at App2.MainPage..ctor() in C:\unotest\App2\App2\App2.Shared\MainPage.xaml.cs:line 28
   at App2.Wasm.MetadataBuilder_638.CreateInstance() in C:\unotest\App2\App2\App2.Wasm\Uno.UI.SourceGenerators\Uno.UI.SourceGenerators.BindableTypeProviders.BindableTypeProvidersSourceGenerator\BindableMetadata.cs:line 23206
   at Windows.UI.Xaml.Controls.Frame.CreatePageInstance(Type sourcePageType)
   at Windows.UI.Xaml.PagePool.DequeuePage(Type pageType)
   at Windows.UI.Xaml.Controls.Frame.CreatePageInstanceCached(Type sourcePageType)
   at Windows.UI.Xaml.Controls.Frame.InnerNavigate(PageStackEntry entry, NavigationMode mode)
   at App2.App.OnNavigationFailed(Object sender, NavigationFailedEventArgs e) in C:\unotest\App2\App2\App2.Shared\App.xaml.cs:line 97
   at Windows.UI.Xaml.Controls.Frame.InnerNavigate(PageStackEntry entry, NavigationMode mode)
   at Windows.UI.Xaml.Controls.Frame.Navigate(Type sourcePageType, Object parameter, NavigationTransitionInfo infoOverride)
   at Windows.UI.Xaml.Controls.Frame.Navigate(Type sourcePageType, Object parameter)
   at App2.App.OnLaunched(LaunchActivatedEventArgs args) in C:\unotest\App2\App2\App2.Shared\App.xaml.cs:line 83
   at Windows.UI.Xaml.Application.Initialize()
   at Uno.UI.Dispatching.CoreDispatcher.InvokeOperationSafe(UIAsyncOperation operation) in C:\a\1\s\src\Uno.UI.Dispatching\Core\CoreDispatcher.cs:line 337

Expected Behavior

SKSwapChainPanel should work with Uno 4.0 - i'm not quite sure if the errors origin is in SkiaSharp or Uno @jeromelaban ?

Actual Behavior
see error message above

Basic Information

  • Version with issue: 2.80.3 but i have also tested it with 2.88.0-preview.171
  • IDE: Visual Studio 20222 Preview
  • Platform Target Frameworks:
    • Uno.Wasm 4.0 on .net6.0

Screenshots

Reproduction Link
repro.zip

@jeromelaban
Copy link
Contributor

Thanks for the report, this will be fixed by #1873

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

No branches or pull requests

2 participants