#component-model #wit-bindgen #wasm-bindings #wasm-interface #wasi #c-sharp

wit-bindgen-csharp

C# bindings generator for WIT and the component model, typically used through the wit-bindgen-cli crate

28 breaking releases

0.41.0 Mar 13, 2025
0.39.0 Feb 5, 2025
0.36.0 Nov 27, 2024
0.28.0 Jul 16, 2024
0.15.0 Nov 27, 2023

#1979 in WebAssembly

Download history 128/week @ 2024-12-01 85/week @ 2024-12-08 56/week @ 2024-12-15 17/week @ 2024-12-22 14/week @ 2024-12-29 207/week @ 2025-01-05 74/week @ 2025-01-12 279/week @ 2025-01-19 56/week @ 2025-01-26 244/week @ 2025-02-02 73/week @ 2025-02-09 74/week @ 2025-02-16 40/week @ 2025-02-23 324/week @ 2025-03-02 430/week @ 2025-03-09 178/week @ 2025-03-16

980 downloads per month
Used in wit-bindgen-cli

Apache-2.0…

265KB
5.5K SLoC

generate the c# and the component module

The following will generate the c# code given a wit file:

cargo run c-sharp --string-encoding utf8 --out-dir testing-csharp tests/codegen/floats.wit

Setup

To run the runtime tests with Native AOT, you need some additional set up

// install wasi-sdk and set env
curl.exe -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sdk-22.0.m-mingw64.tar.gz | tar xzvf -
$env:WASI_SDK_PATH="c:\users\jstur\wasi-sdk-22.0+m\"

Dependencies

~9.5MB
~168K SLoC