SteveSandersonMS / dotnet-wasi-sdk

Packages for building .NET projects as standalone WASI-compliant modules
519 stars 36 forks source link

Is it possible to selectively export classes or static methods in the built .wasm file that can be invoked directly? #19

Closed justingaffney closed 2 years ago

justingaffney commented 2 years ago

I'd like to be able to build a .wasm file from a class library without an entrypoint and expose certain classes or static methods that can be invoked with arguments, to then potentially use in the browser or other environments.

Is this currently possible? If not can arguments be passed into the Main method as a potential alternative?

MindSwipe commented 2 years ago

+1

I'd love to be able to write plugins/ extensions for a server (or any application) in C#, and compile them to WASM and then call into them at runtime

SteveSandersonMS commented 2 years ago

Agreed, we should make this straightforwards to do. I think https://github.com/SteveSandersonMS/dotnet-wasi-sdk/issues/30 will cover this.