Files
wasmtime/crates/misc/dotnet
Peter Huene 9fdf5bce8e Move Wasmtime for .NET to the Wasmtime repo.
This moves the Wasmtime for .NET implementation to the Wasmtime repo.

Wasmtime for .NET is a binding of the Wasmtime API for use in .NET.
2019-11-22 18:26:33 -08:00
..

Wasmtime for .NET

A .NET API for Wasmtime.

Wasmtime for .NET enables .NET code to instantiate WebAssembly modules and to interact with them in-process.

Getting Started

Prerequisites

.NET Core 3.0

Install a .NET Core 3.0+ SDK for your operating system.

Introduction to Wasmtime for .NET

See the introduction to Wasmtime for .NET for a complete walkthrough of how to use Wasmtime for .NET.

Wasmtime for .NET API documentation

See the Wasmtime for .NET API documentation for documentation on using the Wasmtime for .NET types.

Running the "Hello World" Example

The "hello world" example demonstrates a simple C# function being called from WebAssembly.

To run the "hello world" example, follow these instructions:

  1. cd examples/hello
  2. dotnet run

You should see a Hello from C#, WebAssembly! message printed.

Building Wasmtime for .NET

To build Wasmtime for .NET, follow these instructions:

  1. cd src.
  2. dotnet build.

This should produce a Wasmtime.Dotnet.dll assembly in the bin/Debug/netstandard2.1 directory.

To build a release version of Wasmtime for .NET, follow these instructions:

  1. cd src.
  2. dotnet build -c Release.

This should produce a Wasmtime.Dotnet.dll assembly in the bin/Release/netstandard2.1 directory.

Running the tests

To run the Wasmtime for .NET unit tests, follow these instructions:

  1. cd tests.
  2. dotnet test.

Packing Wasmtime for .NET

To create a NuGet package for Wasmtime for .NET, follow these instructions:

  1. cd src.
  2. dotnet pack -c Release.

This should produce a Wasmtime.<version>.nupkg file in the bin/Release directory.

Implementation Status

Status

Feature Status
Wasmtime engine class
Wasmtime store class
Wasmtime module class
Wasmtime instance class 🔄
Module function imports
Module global imports
Module table imports
Module memory imports
Module function exports
Module global exports
Module table exports
Module memory exports
Extern instance functions
Extern instance globals
Extern instance tables
Extern instance memories
Host function import binding
Host global import binding
Host table import binding
Host memory import binding
i32 parameters and return values
i64 parameters and return values
f32 parameters and return values
f64 parameters and return values
AnyRef parameters and return values
Tuple return types for host functions
Trap messages
Trap frames
Create a NuGet package

Legend

Status Icon
Not implemented
In progress 🔄
Completed