Wasmtime 34.0.2
dotnet add package Wasmtime --version 34.0.2
NuGet\Install-Package Wasmtime -Version 34.0.2
<PackageReference Include="Wasmtime" Version="34.0.2" />
<PackageVersion Include="Wasmtime" Version="34.0.2" />
<PackageReference Include="Wasmtime" />
paket add Wasmtime --version 34.0.2
#r "nuget: Wasmtime, 34.0.2"
#:package Wasmtime@34.0.2
#addin nuget:?package=Wasmtime&version=34.0.2
#tool nuget:?package=Wasmtime&version=34.0.2
Installation
You can add a package reference with the .NET SDK:
$ dotnet add package wasmtime
Introduction
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 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- IndexRange (>= 1.0.2)
- System.Memory (>= 4.5.5)
-
.NETStandard 2.1
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (14)
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. |
|
|
Deislabs.WAGI
Provides a configuration driven method to add WAGI modules as route endpoints to ASP.Net Core applications using WAGI.WARNING: WAGI is experimental. It is not considered production-grade by its developers, neither is it "supported" software.. |
GitHub repositories (5)
Showing the top 5 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
|
| Version | Downloads | Last Updated |
|---|---|---|
| 34.0.2 | 13,452 | 8/5/2025 |
| 22.0.0 | 124,314 | 7/9/2024 |
| 21.0.1 | 738 | 6/29/2024 |
| 20.0.2 | 332 | 6/28/2024 |
| 19.0.1 | 17,854 | 4/7/2024 |
| 19.0.0 | 11,398 | 3/27/2024 |
| 18.0.0 | 324 | 3/27/2024 |
| 17.0.0 | 29,256 | 1/26/2024 |
| 16.0.0 | 7,129 | 1/2/2024 |
| 15.0.0 | 1,661 | 11/21/2023 |
| 14.0.0 | 66,875 | 10/24/2023 |
| 13.0.0 | 2,154 | 9/22/2023 |
| 12.0.2 | 374 | 9/21/2023 |
| 12.0.1 | 353 | 9/21/2023 |
| 12.0.0 | 3,010 | 8/21/2023 |
| 11.0.2 | 363 | 9/22/2023 |
| 11.0.1 | 321,672 | 7/27/2023 |
| 11.0.0 | 417 | 7/27/2023 |
| 10.0.2 | 317 | 9/22/2023 |
| 10.0.1 | 354 | 9/22/2023 |
| 10.0.0 | 1,321 | 7/5/2023 |
| 9.0.3 | 929 | 6/2/2023 |
| 9.0.2 | 2,321 | 5/30/2023 |
| 9.0.1 | 30,015 | 5/22/2023 |
| 9.0.0 | 430 | 5/22/2023 |
| 8.0.1 | 4,611 | 4/27/2023 |
| 8.0.0 | 1,077 | 4/21/2023 |
| 7.0.1 | 488 | 4/27/2023 |
| 7.0.0 | 1,186 | 4/1/2023 |
| 6.0.2 | 507 | 4/27/2023 |
| 6.0.1 | 2,047 | 3/8/2023 |
| 6.0.0 | 1,107 | 2/27/2023 |
| 5.0.1 | 802 | 3/8/2023 |
| 5.0.0 | 67,553 | 1/25/2023 |
| 4.0.1 | 592 | 3/8/2023 |
| 4.0.0 | 697 | 1/25/2023 |
| 3.0.0 | 47,044 | 12/8/2022 |
| 2.0.2 | 1,151 | 11/10/2022 |
| 2.0.1 | 850 | 11/9/2022 |
| 2.0.0 | 641 | 11/9/2022 |
| 1.0.2 | 719 | 11/11/2022 |
| 1.0.1 | 657 | 11/9/2022 |
| 1.0.0 | 2,471 | 9/26/2022 |
| 0.40.0-preview1 | 2,938 | 8/29/2022 |
| 0.39.1-preview2 | 3,094 | 8/11/2022 |
| 0.39.1-preview1 | 394 | 8/10/2022 |
| 0.39.0-preview1 | 379 | 8/10/2022 |
| 0.38.1-preview1 | 2,029 | 6/29/2022 |
| 0.38.0-preview1 | 400 | 6/29/2022 |
| 0.37.0-preview1 | 1,075 | 6/14/2022 |
| 0.36.0-preview1 | 1,201 | 4/26/2022 |
| 0.35.2-preview1 | 1,951 | 4/5/2022 |
| 0.35.1-preview1 | 404 | 4/5/2022 |
| 0.35.0-preview1 | 719 | 3/9/2022 |
| 0.34.0-preview1 | 20,216 | 2/11/2022 |
| 0.33.0-preview2 | 18,281 | 1/25/2022 |
| 0.33.0-preview1 | 864 | 1/7/2022 |
| 0.32.1-preview1 | 423 | 1/7/2022 |
| 0.32.0-preview1 | 746 | 12/18/2021 |
| 0.31.0-preview1 | 8,069 | 11/1/2021 |
| 0.30.0-preview1 | 7,262 | 9/17/2021 |
| 0.29.0-preview1 | 1,027 | 8/6/2021 |
| 0.28.0-preview1 | 52,563 | 6/15/2021 |
| 0.27.0-preview1 | 1,348 | 5/22/2021 |
| 0.26.1-preview1 | 458 | 5/21/2021 |
| 0.26.0-preview1 | 980 | 4/20/2021 |
| 0.25.0-preview1 | 1,447 | 3/18/2021 |
| 0.24.0-preview1 | 557 | 3/18/2021 |
| 0.23.0-preview1 | 746 | 2/19/2021 |
| 0.22.1-preview1 | 2,570 | 1/19/2021 |
| 0.22.0-preview1 | 639 | 1/19/2021 |
| 0.21.0-preview1 | 824 | 1/14/2021 |
| 0.20.0-preview1 | 1,764 | 11/2/2020 |
| 0.19.0-preview1 | 1,981 | 7/24/2020 |
| 0.18.1-preview1 | 1,176 | 7/1/2020 |
| 0.18.0-preview1 | 815 | 6/30/2020 |
| 0.15.0-preview1 | 1,289 | 4/6/2020 |
| 0.12.0-preview1 | 1,135 | 2/26/2020 |
| 0.8.0-preview2 | 934 | 12/5/2019 |
| 0.8.0-preview1 | 750 | 11/23/2019 |
| 0.0.1-alpha1 | 761 | 10/2/2019 |
Update Wasmtime to 34.0.2.