#wasi #wit-bindgen #c-sharp #interface-types

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

#1795 in WebAssembly

Download history 27/week @ 2024-12-18 16/week @ 2024-12-25 22/week @ 2025-01-01 244/week @ 2025-01-08 49/week @ 2025-01-15 287/week @ 2025-01-22 40/week @ 2025-01-29 266/week @ 2025-02-05 72/week @ 2025-02-12 48/week @ 2025-02-19 62/week @ 2025-02-26 375/week @ 2025-03-05 461/week @ 2025-03-12 139/week @ 2025-03-19 73/week @ 2025-03-26 139/week @ 2025-04-02

837 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
~167K SLoC