VOOZH about

URL: https://www.nuget.org/packages/WACS.ComponentModel.Harness.Runtime

⇱ NuGet Gallery | WACS.ComponentModel.Harness.Runtime 0.7.5




WACS.ComponentModel.Harness.Runtime 0.7.5

dotnet add package WACS.ComponentModel.Harness.Runtime --version 0.7.5
 
 
NuGet\Install-Package WACS.ComponentModel.Harness.Runtime -Version 0.7.5
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WACS.ComponentModel.Harness.Runtime" Version="0.7.5" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WACS.ComponentModel.Harness.Runtime" Version="0.7.5" />
 
Directory.Packages.props
<PackageReference Include="WACS.ComponentModel.Harness.Runtime" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WACS.ComponentModel.Harness.Runtime --version 0.7.5
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WACS.ComponentModel.Harness.Runtime, 0.7.5"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WACS.ComponentModel.Harness.Runtime@0.7.5
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WACS.ComponentModel.Harness.Runtime&version=0.7.5
 
Install as a Cake Addin
#tool nuget:?package=WACS.ComponentModel.Harness.Runtime&version=0.7.5
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

WACS.ComponentModel.Harness.Runtime

AOT-safe runtime primitives that emitted typed WIT harnesses link against at runtime. Pure C# — no reflection, no Reflection.Emit — so every type here is reachable from harness IL transpiled by NativeAOT or Unity IL2CPP.

Multi-targets net8.0 (annotated IsAotCompatible=true) and netstandard2.1.

What's inside

  • HarnessLoader.Load(byte[], Action<WasmRuntime>?, string) — the canonical-ABI boilerplate every emitted {World}Harness.LoadFrom funnels through: parse the .component.wasm wrapper (via WACS.ComponentModel.Parser), pull the first embedded core module, instantiate it on a fresh WasmRuntime, wire resource handle tables, return a LoadedComponent for the emitter to walk for typed bindings.
  • MemoryHelpers — little-endian readers / writers over a MemoryInstance's backing byte[]. Owns the LE-on-every-width detail so emitted harness IL just calls ReadI32LE / WriteI32LE / etc.
  • StringCoding — canonical-ABI string lift+lower for UTF-8 / UTF-16 / Latin1. Isolated behind one helper so a future swap (e.g. wasi-js-string-builtins externref) lands in one place.
  • HostHandleTable — host-side handle space for own<R> / resource handles that the guest hands to the host. Separate from the wasm-side rep table maintained by the runtime.
  • Borrowed<T> — the lifetime-distinct view of a resource: borrow<R> references that the host received from wasm without participating in the host handle table. The struct is intentionally not IDisposable — code that took a borrow can't accidentally release it.
  • WitContract + WitContractMismatchException — typed WIT model for runtime + compile-time validation; emitted harnesses embed the WIT source as _WitContract and the validator parses it back to diff against the component's embedded WIT custom section.
  • WitResult, WitTupleAccess — helpers for the Result<T,E> and tuple<...> shapes emitted harness IL needs to construct + destructure.

How it relates to the other WACS packages

.wit files
 │
 ▼ (build time)
WACS.ComponentModel.Harness.Lib ──► {World}Harness.dll
 │ │
 │ references │ references
 ▼ ▼
WACS.ComponentModel.Parser WACS.ComponentModel.Harness.Runtime (this)
 │
 ▼
 WACS.Core (interpreter)

A consumer running an emitted harness only needs this package plus WACS at runtime — the emitter (Harness.Lib) is a build-time tool, not a runtime dependency.

Package Role
WACS.ComponentModel.Harness.Runtime this — runtime primitives the emitted harness DLL calls into
WACS.ComponentModel.Harness.Lib Build-time emitter — produces the {World}Harness.dll
WACS.ComponentModel.Parser Used internally by HarnessLoader.Load to walk the .component.wasm
WACS Core interpreter; HarnessLoader instantiates the embedded core module on a WasmRuntime
WACS.Transpiler.Lib Alternative engine — emits a {World}HarnessImpl : I{World} against the same surface

Why a separate package

The emitter (Harness.Lib) needs PersistedAssemblyBuilder and targets net9.0. The runtime the emitter's output links against has no such requirement — it's pure canonical-ABI helpers. Splitting them lets consumers ship the emitted harness DLL alongside this small AOT-safe runtime, on net8.0 or netstandard2.1, without dragging the emitter into the application image.

This is the same shape WACS uses elsewhere: WACS.Transpiler.Lib vs WACS.Transpiler.Runtime, WACS.ComponentModel.Bindgen.Lib vs the WACS.ComponentModel.Bindgen.SourceGen analyzer.

Reference

The cross-engine symmetry story (interpreter {World}Harness vs transpiler {World}HarnessImpl : I{World}) is documented in docs/WIT_HARNESS_APPROACH.md.

License

Apache-2.0

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 netstandard2.1 is compatible. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on WACS.ComponentModel.Harness.Runtime:

Package Downloads
WACS.ComponentModel.Harness.Lib

Build-time IL emitter for typed WIT harnesses. Takes a WIT contract (either as a directory of `.wit` files or a pre-parsed CtPackage set) and emits a .NET assembly containing the typed harness class with `LoadFrom(byte[])` + per-export typed methods. Two ergonomic surfaces over one emit core: `EmitToFile` / `EmitToStream` for persisted .dll output (the `wacs harness gen` flow) and `EmitInMemory` for immediate consumption (the `wacs run --wit-dir` flow). Targets net9.0 to use PersistedAssemblyBuilder for the AOT-clean save+load round-trip.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.5 110 5/28/2026
0.7.4 112 5/28/2026