WASI in .NET 10 Preview 6
At the time of writing .NET 10 Preview 6 is the latest release. I used it for the WASI "Hello World" level experiments described below.
All .NET 10 experiments are available in the dotnet-10 folder that is part of my disorganized Github repository of Wasm experiments.
TL;DR:
.NET 10 will not have support for WASI.
Use componentize-dotnet
(or wasmtime-dotnet)
if you want to work with WASI in .NET 10.
WASI: .NET 9 Recap 😒
During the preview cycle leading up to .NET 9 RTM the wasi-experimental
workload changed from having working support for WASI Preview 1 to
working towards support for WASI preview 2.
Quite reasonably Preview 1 was no longer supported due to lack of
"dev bandwidth to support multiple build configurations",
but the problem was that Microsoft never got around to finishing support
for WASI Preview 2, so now there was no support for WASI.
The wasi-experimental workload support was removed from .NET 9 in a
pull request merged in February 2025,
which was well after the .NET 9 RTM release in November 2024.
The PR hinted at wasi-experimental support returning in .NET 10.
Checking .NET 10: "Hello World" 😞
To check up on the WASI support in .NET 10 Preview 6 I started
with the most basic thing: Installing the wasi-experimental workload and use
the wasiconsole template to generate a "Hello World" console app.
The program generated by the template could not run, so I and created a Github issue and it seems like .NET 10 will not support WASI. So I looked at a couple of the WASI tracking issues.
WASI Planning in dotnet/runtime 😴
I revisited two of the WASI tracking / planning issues in dotnet/runtime:
"WASI support tracking" and
"WASI Developer Experience Goals".
It turn out that about a month after .NET 9 was released the milestone on
both issues changed from 10.0.0 to Future.
I have not been able to find a tracking ticket for fixing WASI Preview 2,
but I guess that shouldn't be a surprise at this point.
.NET 10 + componentize-dotnet 🥇
As for .NET 9 the good news is the Bytecode Alliance project
componentize-dotnet.
It still works with .NET 10 Preview 6, so fingers crossed.
I followed the "Getting started" in the README.md from the repository and was able to get both the "Hello World" console app and a "WASI 0.2 component" example to work without much effort. I used Wasmtime 34.0.2 to run the examples.
.NET 10 + wasmtime-dotnet 🥈
Another .NET project under the Bytecode Alliance umbrella is wasmtime-dotnet
that can be used to embed Wasmtime in .NET projects to load and
call Wasm (and wat) files.
The project used to be updated to latest Wasmtime on a regular basis,
but wasmtime-dotnet hasn't had a release for more than a year and
is still at 22.0.0, which is quite a long way from the latest release of
Wasmtime, which is 35.0.0.
The good news is that I had a simple .NET 8 console application loading a wat
file implementing add and subtract. That still works in .NET 10 Preview 6.
The only change I made was setting target framework to net10.0 in the
.csproj file.
A community contributor recently did the upgrade from Wasmtime
22.0.0 to 34.0.1.
But it sounds like there is still work
that needs to be done in Wasmtime and wasmtime-dotnet before WASI
Preview 2 components can be used.
Conclusion
WASI itself has been moving forward at a glacial pace, but WASI in .NET even slower. WASI has been broken for more than a year and will not be working in .NET 10. It does not seem to be a priority for Microsoft at all.
componentize-dotnet works at the moment, but I am worried because
it, to some extent, relies upon .NET 10.
wasmtime-dotnet has had a slow year, but seems to be picking up steam, but it
is still too early to tell what will happen.