-
Notifications
You must be signed in to change notification settings - Fork 543
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
ZipArchive is not functioning in Blazor WebAssembly when using System.IO.Compression.ZipArchive and SkiaSharp v3.118.0-preview.1.2 in .NET 9.0. #3067
Comments
This may be fixed with #3064 Can you try the nightly on the preview feed:
Let me know if this fixes it and I will push out the 3.x release. |
Hi @pandi123. We have added the |
The stable 2.x packages should now have the correct WASM binaries for .NET 9. The new version number to use is Note: I probably won't be able to backport the changes to make installing the WebAssembly package automatically include the binaries, so if you still need to use 2.x for some reason, you will need the manual include that you have shown. With .NET 9, there is a bug in the runtime sou you will also have to temporarily include this workaround in your app csproj: <!-- Workaround for https://github.com/dotnet/runtime/issues/109289 -->
<Target Name="RuntimeIssue109289_Workaround"
AfterTargets="_BrowserWasmWriteRspForLinking">
<ItemGroup>
<_WasmLinkStepArgs Remove="@(_EmccLinkStepArgs)" />
<_EmccLinkStepArgs Remove=""%(_WasmNativeFileForLinking.Identity)"" />
<_WasmLinkDependencies Remove="@(_WasmNativeFileForLinking)" />
<_SkiaSharpToReorder Include="@(_WasmNativeFileForLinking)" Condition="$([System.String]::Copy('%(FullPath)').Contains('libSkiaSharp.a'))" />
<_WasmNativeFileForLinking Remove="@(_SkiaSharpToReorder)" />
<_WasmNativeFileForLinking Include="@(_SkiaSharpToReorder)" />
<_EmccLinkStepArgs Include=""%(_WasmNativeFileForLinking.Identity)"" />
<_WasmLinkDependencies Include="@(_WasmNativeFileForLinking)" />
<_WasmLinkStepArgs Include="@(_EmccLinkStepArgs)" />
</ItemGroup>
</Target> I am not sure when the real fix will appear in .NET 9, but this also is going to be difficult to backport. The latest 3.x series will have this fix. So hopefully, once my PR #3082 is merged then you will not need the manual include of the .a file and the app should run without workarounds. If you install the SkiaSharp.Views.Blazor nightly nuget now, it should work today. The final PR is just moving the fix lower down the dependencies. I was hoping to make 3.x stable last week, but I was not able to get to it. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. |
Description
We are experiencing an issue with the System.IO.Compression.ZipArchive and SkiaSharp package v3.118.0-preview.1.2 in our Blazor WebAssembly .NET 9.0 project. The problem began after we added the following line in our .csproj file:
This issue does not occur when using the SkiaSharp package v2.88.8 or checking .NET 8.0 working fine. I have attached a sample project and a screenshot of the issue for your reference.
Platform: Blazor wasm
Visual Studio version: 2022
.NET version : .NET9
SkiaSharp version : v3.118.0-preview.1.2
Code
Expected Behavior
The program should run without any exceptions in blazor wasm while using System.IO.Compression.ZipArchive and SkiaSharp package v3.118.0-preview.1.2
Actual Behavior
Aborted(Assertion failed: native function
stackRestore
called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits))The thread '.NET TP Worker' (33996) has exited with code 0 (0x0).
The thread '.NET TP Worker' (42984) has exited with code 0 (0x0).
Uncaught RuntimeError RuntimeError: unreachable
at $__trap (wasm/022f640e.wat:3678318:1)
at ___trap (localhost꞉7023/_framework/dotnet.native.krq9w4nbeb.js:11275:54)
at abort (localhost꞉7023/_framework/dotnet.native.krq9w4nbeb.js:775:5)
at assert (localhost꞉7023/_framework/dotnet.native.krq9w4nbeb.js:468:5)
at (localhost꞉7023/_framework/dotnet.native.krq9w4nbeb.js:808:5)
at (d:\Net9\ZipArchive3.118.0-preview.1.2\ZipArchive3.118.0-preview.1.2\wwwroot_framework\https:\raw.githubusercontent.com\dotnet\runtime\9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3\src\mono\browser\runtime\invoke-cs.ts:328:20)
at beginInvokeDotNetFromJS (localhost꞉7023/_framework/blazor.webassembly.js:1:43656)
at invokeDotNetMethodAsync (localhost꞉7023/_framework/blazor.webassembly.js:1:3978)
at invokeMethodAsync (localhost꞉7023/_framework/blazor.webassembly.js:1:5486)
at (localhost꞉7023/_framework/blazor.webassembly.js:1:13036)
at R (localhost꞉7023/_framework/blazor.webassembly.js:1:13214)
at (localhost꞉7023/_framework/blazor.webassembly.js:1:52854)
at invokeWhenHeapUnlocked (localhost꞉7023/_framework/blazor.webassembly.js:1:44875)
at (localhost꞉7023/_framework/blazor.webassembly.js:1:52817)
at R (localhost꞉7023/_framework/blazor.webassembly.js:1:52844)
at I (localhost꞉7023/_framework/blazor.webassembly.js:1:13005)
at dispatchGlobalEventToAllElements (localhost꞉7023/_framework/blazor.webassembly.js:1:15626)
at onGlobalEvent (localhost꞉7023/_framework/blazor.webassembly.js:1:14835)
Version of SkiaSharp
3.118.0-preview.1 (Next Preview)
Last Known Good Version of SkiaSharp
2.88.8 (Previous)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Window11
Devices
Visual studio v2022
Issue reproducing sample
ZipArchive3.118.0-preview.1.2.zip
Working sample
ZipArchive 2.88.8.zip
Relevant Screenshots
No response
Relevant Log Output
Code of Conduct
The text was updated successfully, but these errors were encountered: