Can a non-Blazor C# project that depends on SDL2 run in the browser? Issues with Wasmtime runtime errors #21811
Replies: 1 comment
-
Hi, for .NET 6.0 you'll want https://github.com/dotnet/runtime |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I’m trying to determine if a non-Blazor, C# project that depends on SDL2 can be run in the browser.
I'm exploring options to run this project using WebAssembly without Blazor, and I've encountered the following issues with the Wasm build:
When running
GencsLib.wasm
(compiled with thewasi.sdk
package) usingwasmtime
, I encounter this error:[wasm_trace_logger] * Assertion at /home/runner/work/dotnet-wasi-sdk/dotnet-wasi-sdk/modules/runtime/src/mono/mono/metadata/loader.c:1818, condition `mono_metadata_token_table (m->token) == MONO_TABLE_METHOD' not met
Running
TestProgram.wasm
returns:Unhandled Exception: System.DllNotFoundException: SDL2 at GencsLib.GameWindow.CreateWindow(String title, Int32 width, Int32 height) at Program.Main()
The framework is targeting .NET 6.0.
The project relies on SDL2# to create a game window but does not use Blazor.
I would like to know if there's a feasible path to getting a .NET 6.0 SDL2-dependent project running as a WebAssembly in the browser. Any guidance or insights on compatibility with SDL2 and Wasm in this context would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions