Produce a WASI reactor from C# #98888
Replies: 2 comments
-
I go through your issue. If you are working with wasm. Your application must have at least one starting point. It means you can't remove the main method from the project. If you remove it manually. It is throwing an error like the main method not found because when you compile the project compiler try to find the main method . But it does not exist in code due to that reason. It is throwing an error in your case. |
Beta Was this translation helpful? Give feedback.
-
No, the feature set we were able to finish and ship in .NET 8 is basically producing a WASI application. We are continuing in 9 and further. Producing Library is tracked in #96869.
|
Beta Was this translation helpful? Give feedback.
-
Hi all!
I am very new to .NET and WebAssembly, so please forgive me if I use the wrong terminology here.
I was able to produce a WASM executable from a C# project using the
wasi-wasm
runtime. This required my C# program to declare aMain
function as entry point and produced a WASI command pattern bundle. Now I would like to instead produce something more similar to a shared library, or what I think in WASI would be a reactor. I tried to remove theMain
function and set<OutputType>Library</OutputType>
in my project, but I got an error like this one in mydotnet build
:Is this not supported at the moment?
It is also unclear to me how I in my C# code can declare a function that ends up getting exported in the WASM image. I have read some comments regarding using
UnmanagedCallersOnly
, but I have so far not been able to get anything that works.Beta Was this translation helpful? Give feedback.
All reactions