C# (.NET) now supports a new platform: key changes and prospects
Microsoft continues to actively expand the boundaries of the .NET ecosystem. As part of the latest update, the development team announced the addition of support for a new platform for the C# language. This decision opens up additional opportunities for programmers to create modern applications without being limited to traditional runtime environments.
The new platform in question is WebAssembly System Interface (WASI). Previously, .NET already supported WebAssembly for browsers, but now the .NET 8+ runtime allows running C# code outside the browser — on servers, edge devices, and cloud environments via WASI. This is a step towards true cross-platform compatibility, where the same code can run on Windows, Linux, macOS, and even in isolated sandbox environments.
What does this mean for developers?
WASI support in .NET is not just a technical innovation. It solves several fundamental problems:
- Versatility: C# applications can now run in environments where Python, Rust, or Go were previously required — for example, in cloud functions (serverless) or IoT devices.
- Security: WASI provides strict isolation (sandbox), which is critical for multi-tenant services and executing untrusted code.
- Performance: Thanks to the native AOT compiler (Ahead-of-Time) in .NET 8, C# applications under WASI launch almost instantly, without JIT compilation delays.
How does it work in practice?
Microsoft has released a preliminary version of dotnet wasi-experimental — a package that allows compiling C# projects into WASI modules. The process is simple:
- Simply install the .NET 8 SDK and add the NuGet package
Wasi.Sdk. - Write regular C# code (for example, a console application).
- Build the project with the
--wasiflag — the output will be a.wasmfile. - Run it in any environment that supports WASI (for example, Wasmtime or Wasmer).
It is important to note that at this stage, support is not complete: some features, such as multithreading and direct file system access, are currently limited. However, for server scenarios, microservices, and computational tasks, this is already sufficient.
Competition with Python and Rust
For a long time, Python and Rust dominated scenarios requiring portability and security (for example, in WebAssembly). C# with WASI support enters this niche with the advantage of a rich standard library and familiar syntax. For teams already using .NET, this means a lower entry barrier: there is no need to learn a new language to deploy an application on edge platforms.
Additionally, Microsoft is actively collaborating with the Bytecode Alliance project, which develops the WASI standard. This ensures that .NET will remain compatible with future versions of the specification.
What's next?
WASI support in .NET is currently an experimental feature, but stabilization and API expansion are expected in .NET 9. Developers should start testing now to be ready for migration by the time of the official release.
For those accustomed to Python, this could be a reason to consider C# as an alternative for