#c-sharp #wit #wit-bindgen #module #wasi

wit-bindgen-csharp

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

29 breaking releases

new 0.42.1 May 6, 2025
0.41.0 Mar 13, 2025
0.36.0 Nov 27, 2024
0.28.0 Jul 16, 2024
0.15.0 Nov 27, 2023

#1672 in WebAssembly

Download history 46/week @ 2025-01-14 289/week @ 2025-01-21 44/week @ 2025-01-28 258/week @ 2025-02-04 79/week @ 2025-02-11 54/week @ 2025-02-18 52/week @ 2025-02-25 362/week @ 2025-03-04 460/week @ 2025-03-11 146/week @ 2025-03-18 83/week @ 2025-03-25 114/week @ 2025-04-01 128/week @ 2025-04-08 110/week @ 2025-04-15 572/week @ 2025-04-22 241/week @ 2025-04-29

1,070 downloads per month
Used in 2 crates

Apache-2.0…

275KB
6K SLoC

generate the c# and the component module

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

cargo run csharp --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

~6MB
~123K SLoC