Is it possible to run .NET in browser worklets? #96024
-
Worklets are loaded by the browser from a separate file. I am not familiar with blazor (especially the publishing process), but I think the runtime must first be loaded as a wasm module before my C# code can be executed. Is this supported or planned to be supported? I found that someone achieved this with rust (speratus/web-synth-proto2), which uses javascript and Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
pavelsavara
Dec 15, 2023
Replies: 1 comment 3 replies
-
cc @pavelsavara |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have 2 flavors of dotnet for wasm, one is targeted to "OS" Browser and the other to WASI.
Here is simple dotnet on wasm demo I wrote for Net7. It will work for Net8 too. That is targeting browser JavaScript APIs.
https://github.com/pavelsavara/dotnet-wasm-todo-mvc
I think this is close to what you want.
It would work in webworker (we are planning more specific demo soon #95452)
But running it in worklet could be more challenging. Keep us posted 😉
The WASI flavor is much less mature. Also the browser ecosystem is not very ready to run WASI. You can read more about our WASI thought here https://devblogs.microsoft.com/dotnet/extending-web-assembly-to-the-cloud/