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] .NET 9 Blazor exception: Could not load type of field 'SkiaSharp.Views.Blazor.Internal.JSModuleInterop:moduleTask' ... #2991

Open
1 task done
Apollo3zehn opened this issue Sep 6, 2024 · 0 comments · May be fixed by #3064
Labels

Comments

@Apollo3zehn
Copy link

Description

The Blazor sample application is not working with .NET 9 Preview 7. It gives me the following error:

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Could not set up parent class, due to: Could not load type of field 'SkiaSharp.Views.Blazor.Internal.JSModuleInterop:moduleTask' (0) due to: Could not resolve type with token 0100003b from typeref (expected class 'Microsoft.JSInterop.IJSUnmarshalledObjectReference' in assembly 'Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60') assembly:Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 type:Microsoft.JSInterop.IJSUnmarshalledObjectReference member:(null) assembly:SkiaSharp.Views.Blazor.dll type:JSModuleInterop member:(null)
System.TypeLoadException: Could not set up parent class, due to: Could not load type of field 'SkiaSharp.Views.Blazor.Internal.JSModuleInterop:moduleTask' (0) due to: Could not resolve type with token 0100003b from typeref (expected class 'Microsoft.JSInterop.IJSUnmarshalledObjectReference' in assembly 'Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60') assembly:Microsoft.JSInterop, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 type:Microsoft.JSInterop.IJSUnmarshalledObjectReference member:(null) assembly:SkiaSharp.Views.Blazor.dll type:JSModuleInterop member:(null)
   at SkiaSharp.Views.Blazor.SKCanvasView.OnAfterRenderAsync(Boolean firstRender)

This does not happen when targeting .NET 8 (and downgrading the ASP.NET Core Nuget dependencies Microsoft.AspNetCore.Components.WebAssembly and Microsoft.AspNetCore.Components.WebAssembly.DevServer to .NET 8).

Skia Sharp Version 3.0.0-preview.4.1

Code

  1. Install .NET 9 preview 7 SDK
  2. Clone https://github.com/Apollo3zehn/SkiaSharpBlazorIssue
  3. Run the application
  4. Go to http://localhost:5000/raster
  5. Open the Browser developer tools and find the error

Expected Behavior

I expect the Blazor sample (https://github.com/mono/SkiaSharp/tree/main/samples/Basic/BlazorWebAssembly) to work as it does with .NET 8.

Actual behavior

grafik

Actual Behavior

The error shown in the description above and in the screenshot below appears.

Version of SkiaSharp

Other (Please indicate in the description)

Last Known Good Version of SkiaSharp

2.88.2 (Previous)

IDE / Editor

Visual Studio Code (Linux)

Platform / Operating System

Linux

Platform / Operating System Version

.NET 9 Preview 7
Kubuntu 24.04
x64
Firefox Browser 130.0
Edge Browser 128.0.2739.63

Devices

No response

Relevant Screenshots

grafik

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mattleibow mattleibow linked a pull request Nov 13, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant