← Back to blog
Archive · WASM2019-05-04 · 1 min

WasmSample: .NET on WebAssembly with Mono.WebAssembly.Sdk

In 2019 I published WasmSample, a small demonstration of .NET running in a browser as WebAssembly. No plugin required. The original post is at x.com/jacano35/status/1124476690640572416.


Why WASM

WebAssembly lets code run in the browser at near-native speed. For me, that meant using C# in a place where I would normally reach for JavaScript.

The project also closed a circle for me. In 2017, I added WASM support for the IL opcodes neg, not, switch, throw, and nop to dotnet/corert. Two years later, I could share a sample that used that work.


What is inside

The sample is small on purpose:

  • A Shell project and a WASM project.
  • A build.sh script and a scripts folder.
  • The Mono runtime, compiled to WASM, running in the page.

Run it

Clone the repository, run the build script, and open the result in a browser. The README contains the steps.

The code is at github.com/jacano/WasmSample, and it is open for pull requests.


First shared May 4, 2019 at x.com/jacano35. Republished 2026 on jacano.dev.