![]() |
VOOZH | about |
dotnet add package Wasmtime --version 44.0.0
NuGet\Install-Package Wasmtime -Version 44.0.0
<PackageReference Include="Wasmtime" Version="44.0.0" />
<PackageVersion Include="Wasmtime" Version="44.0.0" />Directory.Packages.props
<PackageReference Include="Wasmtime" />Project file
paket add Wasmtime --version 44.0.0
#r "nuget: Wasmtime, 44.0.0"
#:package Wasmtime@44.0.0
#addin nuget:?package=Wasmtime&version=44.0.0Install as a Cake Addin
#tool nuget:?package=Wasmtime&version=44.0.0Install as a Cake Tool
You can add a package reference with the .NET SDK:
$ dotnet add package wasmtime
For this introduction, we'll be using a simple WebAssembly module that imports a hello function and exports a run function:
(module
(func $hello (import "" "hello"))
(func (export "run") (call $hello))
)
To use this module from .NET, create a new console project:
$ mkdir wasmintro
$ cd wasmintro
$ dotnet new console
Next, add a reference to the Wasmtime package:
$ dotnet add package wasmtime
Replace the contents of Program.cs with the following code:
using System;
using Wasmtime;
using var engine = new Engine();
using var module = Module.FromText(
engine,
"hello",
"(module (func $hello (import \"\" \"hello\")) (func (export \"run\") (call $hello)))"
);
using var linker = new Linker(engine);
using var store = new Store(engine);
linker.Define(
"",
"hello",
Function.FromCallback(store, () => Console.WriteLine("Hello from C#!"))
);
var instance = linker.Instantiate(store, module);
var run = instance.GetAction("run")!;
run();
An Engine is created and then a WebAssembly module is loaded from a string in WebAssembly text format.
A Linker defines a function called hello that simply prints a hello message.
The module is instantiated and the instance's run export is invoked.
To run the application, simply use dotnet:
$ dotnet run
This should print Hello from C#!.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Wasmtime:
| Package | Downloads |
|---|---|
|
DevCycle.SDK.Server.Local
.NET Server Local Bucketing SDK for DevCycle |
|
|
Opa.Wasm
Call Open Policy Agent (OPA) policies in WASM (Web Assembly) from .NET |
|
|
OpaDotNet.Wasm
Open Policy Agent (OPA) WebAssembly dotnet core SDK |
|
|
DOPA
A .NET API for evaluating OPA policies compiled as WebAssembly modules. |
|
|
OpenFeature.Providers.GOFeatureFlag
GO Feature Flag provider for .NET |
Showing the top 6 popular GitHub repositories that depend on Wasmtime:
| Repository | Stars |
|---|---|
|
PixiEditor/PixiEditor
PixiEditor is a Universal Editor for all your 2D needs
|
|
|
6over3/bebop
🎷No ceremony, just code. Blazing fast, typesafe binary serialization.
|
|
|
SteveSandersonMS/DotNetIsolator
A library for running isolated .NET runtimes inside .NET
|
|
|
JasonBock/Rocks
A mocking library based on the Compiler APIs (Roslyn + Mocks)
|
|
|
bytecodealliance/wasmtime-demos
Historical and dated demos for Wasmtime usage and WASI content
|
|
|
akeit0/okojo
Okojo is an experimental low allocation managed JavaScript engine for .NET
|
| Version | Downloads | Last Updated |
|---|---|---|
| 44.0.0 | 4,105 | 5/23/2026 |
| 34.0.2 | 157,992 | 8/5/2025 |
| 22.0.0 | 249,332 | 7/9/2024 |
| 21.0.1 | 1,067 | 6/29/2024 |
| 20.0.2 | 680 | 6/28/2024 |
| 19.0.1 | 19,184 | 4/7/2024 |
| 19.0.0 | 11,990 | 3/27/2024 |
| 18.0.0 | 742 | 3/27/2024 |
| 17.0.0 | 32,687 | 1/26/2024 |
| 16.0.0 | 8,551 | 1/2/2024 |
| 15.0.0 | 10,576 | 11/21/2023 |
| 14.0.0 | 71,385 | 10/24/2023 |
| 13.0.0 | 2,486 | 9/22/2023 |
| 12.0.2 | 661 | 9/21/2023 |
| 12.0.1 | 675 | 9/21/2023 |
| 12.0.0 | 3,323 | 8/21/2023 |
| 11.0.2 | 652 | 9/22/2023 |
| 11.0.1 | 456,410 | 7/27/2023 |
| 10.0.2 | 615 | 9/22/2023 |
| 10.0.1 | 648 | 9/22/2023 |
Update Wasmtime to 44.0.0.