Update the .NET docs for the current .NET API. (#2069)

This commit is contained in:
Peter Huene
2020-07-24 21:49:05 -07:00
committed by GitHub
parent bad99c93b1
commit 9b340f27f7

View File

@@ -23,7 +23,7 @@ Next, add a reference to the Wasmtime NuGet package to your project:
```text
$ dotnet add package --version 0.15.0-preview1 wasmtime
$ dotnet add package --version 0.19.0-preview1 wasmtime
```
Copy this example WebAssembly text module into your project directory as `gcd.wat`.
@@ -46,10 +46,12 @@ namespace Tutorial
{
static void Main(string[] args)
{
using var host = new Host();
using var module = host.LoadModuleText("gcd.wat");
using var engine = new Engine();
using var module = Module.FromTextFile(engine, "gcd.wat");
using var host = new Host(engine);
using dynamic instance = host.Instantiate(module);
Console.WriteLine($"gcd(27, 6) = {instance.gcd(27, 6)}");
}
}