AngleSharp.Wasm
1.2.0
dotnet add package AngleSharp.Wasm --version 1.2.0
NuGet\Install-Package AngleSharp.Wasm -Version 1.2.0
<PackageReference Include="AngleSharp.Wasm" Version="1.2.0" />
<PackageVersion Include="AngleSharp.Wasm" Version="1.2.0" />
<PackageReference Include="AngleSharp.Wasm" />
paket add AngleSharp.Wasm --version 1.2.0
#r "nuget: AngleSharp.Wasm, 1.2.0"
#:package AngleSharp.Wasm@1.2.0
#addin nuget:?package=AngleSharp.Wasm&version=1.2.0
#tool nuget:?package=AngleSharp.Wasm&version=1.2.0

AngleSharp.Wasm
AngleSharp.Wasm extends the core AngleSharp library with the ability to run WebAssembly. This repository is the home of the source for the AngleSharp.Wasm NuGet package.
Documentation
Further documentation is available in the docs folder:
Basic Configuration
If you just want a configuration that works you should use the following code:
var config = Configuration.Default
.WithWasm(); // from AngleSharp.Wasm
This will register everything related for running WebAssembly.
Host Imports
If your module imports host functions, register imports via WithWasmImports(...):
var config = Configuration.Default
.WithWasm()
.WithWasmImports(_ =>
{
return new[]
{
new WasmImportFunction(
"host",
"answer",
Array.Empty<WasmValueType>(),
new[] { WasmValueType.Int32 },
_ => 41),
};
});
DOM / JS Integration
With AngleSharp.Js, scripts get the WebAssembly JavaScript API as in browsers:
const memory = new WebAssembly.Memory({ initial: 1 });
const { instance } = await WebAssembly.instantiateStreaming(fetch('program.wasm'), {
env: { memory, log: (value) => console.log(value) },
});
new Uint8Array(memory.buffer)[0] = 42;
instance.exports.run();
WebAssemblyis a namespace object withvalidate,compile,instantiate,compileStreamingandinstantiateStreaming(giving promises) and the interfacesModule,Instance,Memory,Table,Global,Tag,Exception,CompileError,LinkErrorandRuntimeError.- Import objects take functions of scripts, numbers and BigInts (for globals), and memories, tables and globals;
instance.exportsholds functions scripts call and the objects of memories, tables and globals. memory.bufferis an ArrayBuffer sharing the bytes of the memory (the default Wasmtime backend keeps the memories in pinned .NET arrays), so writes of scripts and of WebAssembly see each other.
The objects of a browsing context live in one Wasmtime store, so they can be imported by any of its modules.
For C#, the synchronous bridge methods remain:
var module = WebAssembly.Compile(context.Current!, wasmBytes);
var instance = WebAssembly.Instantiate(context.Current!, module);
var result = instance.Invoke("answer");
Runtime Backend
The current default backend uses Wasmtime and targets modern .NET runtimes.
Target Frameworks
The current package targets net8.0 and net10.0.
Features
- Runtime registration via
WithWasm() - Optional host import registration via
WithWasmImports(...) - Default Wasmtime backend
- Module metadata extraction
exports()imports()customSections(name)
- Module validation via
validate(bytes) - Response-based compilation and instantiation via
compileStreaming(response)andinstantiateStreaming(response) - Compile option routing for
builtinsandimportedStringConstants - Instance export access
exportslookup by export name- export key enumeration
- Export invocation helpers
instance.Invoke(...)WasmJsExportedFunction.Invoke(...)
- WebAssembly object projections
- memory
buffer,read,write, andgrow - table
length,get,set, andgrow - global
valueandvalueOf - tag
type().parameters - exception
is(tag)andgetArg(tag, index) CompileError,LinkError, andRuntimeError
- memory
- Multi-target support for
net8.0andnet10.0
Current Scope and Limitations
AngleSharp.Wasm currently provides a practical subset of the WebAssembly JS API.
- Streaming APIs read the whole response before compiling, because module metadata requires the complete binary.
- Shared memories (
shared: true) are not supported. - The JavaScript API needs the default Wasmtime backend; custom runtimes are used by the C# bridge methods.
- Compile options are validated and forwarded to capable runtimes. Wasmtime 44 does not expose JavaScript string builtins or imported string constants, so requesting either option with the default backend throws
NotSupportedException. - Exported memories, tables, globals, and tags have object projections; other non-function exports remain descriptors (
name,kind). - Host-created tags and exceptions are supported. Wasmtime 44 does not expose native Tag or Exception handles or enable exception modules through its .NET API, so runtime-thrown Wasm exceptions are not yet projected.
See Spec Coverage Matrix for a section-by-section status overview.
Participating
Participation in the project is highly welcome. For this project the same rules as for the AngleSharp core project may be applied.
If you have any question, concern, or spot an issue then please report it before opening a pull request. An initial discussion is appreciated regardless of the nature of the problem.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
For more information see the .NET Foundation Code of Conduct.
.NET Foundation
This project is supported by the .NET Foundation.
License
AngleSharp.Wasm is released using the MIT license. For more information see the license file.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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 is compatible. 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. |
-
net10.0
- AngleSharp (>= 1.11.0)
- Wasmtime (>= 44.0.0)
-
net8.0
- AngleSharp (>= 1.11.0)
- Wasmtime (>= 44.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AngleSharp.Wasm:
| Package | Downloads |
|---|---|
|
AngleSharp.Browser
A UI-agnostic browser engine bringing the AngleSharp ecosystem together. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 0 | 11/24/2026 |
| 1.2.0-beta.51 | 0 | 11/24/2026 |
| 1.2.0-beta.45 | 12 | 11/23/2026 |
| 1.2.0-beta.44 | 41 | 11/23/2026 |
| 1.1.1 | 225 | 11/12/2026 |
| 1.1.1-beta.40 | 51 | 11/12/2026 |
| 1.1.1-beta.38 | 55 | 11/12/2026 |
| 1.1.1-beta.34 | 52 | 11/9/2026 |
| 1.1.1-beta.32 | 55 | 11/9/2026 |
| 1.1.0 | 306 | 8/21/2026 |
| 1.1.0-beta.25 | 68 | 11/1/2026 |
| 1.1.0-beta.21 | 102 | 8/17/2026 |
| 1.0.0 | 156 | 7/31/2026 |
| 1.0.0-beta.20 | 93 | 8/8/2026 |
| 1.0.0-beta.15 | 89 | 7/31/2026 |
| 1.0.0-beta.13 | 88 | 7/29/2026 |
| 0.13.0 | 38,900 | 6/12/2021 |
| 0.13.0-beta.11 | 82 | 7/28/2026 |
| 0.13.0-beta.9 | 88 | 7/28/2026 |
| 0.13.0-beta.8 | 91 | 7/28/2026 |