WACS.WASI.GFX.DependencyInjection 0.1.1-preview

This is a prerelease version of WACS.WASI.GFX.DependencyInjection.
dotnet add package WACS.WASI.GFX.DependencyInjection --version 0.1.1-preview
                    
NuGet\Install-Package WACS.WASI.GFX.DependencyInjection -Version 0.1.1-preview
                    
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.WASI.GFX.DependencyInjection" Version="0.1.1-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WACS.WASI.GFX.DependencyInjection" Version="0.1.1-preview" />
                    
Directory.Packages.props
<PackageReference Include="WACS.WASI.GFX.DependencyInjection" />
                    
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.WASI.GFX.DependencyInjection --version 0.1.1-preview
                    
#r "nuget: WACS.WASI.GFX.DependencyInjection, 0.1.1-preview"
                    
#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.WASI.GFX.DependencyInjection@0.1.1-preview
                    
#: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.WASI.GFX.DependencyInjection&version=0.1.1-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=WACS.WASI.GFX.DependencyInjection&version=0.1.1-preview&prerelease
                    
Install as a Cake Tool

WACS.WASI.GFX.DependencyInjection

Microsoft.Extensions.DependencyInjection extensions for WACS.WASI.GFX. Symmetric with WACS.WASI.NN.DependencyInjection and WACS.WASI.Preview2.DependencyInjection.

Usage

using Wacs.WASI.Preview2.DependencyInjection;
using Wacs.WASI.GFX.DependencyInjection;
using Wacs.WASI.GFX.Silk;

services
    .AddWasiPreview2()
    .AddWasiGfx(b => b.WithBackend(new SilkGfxBackend()))
    .AddWasiPreview2GfxBundle();   // composite for the
                                   // single hostBundle slot

The composite WasiPreview2GfxBundle forwards property lookups to either the Preview2 sub-bundle or the wasi-gfx sub-bundle. Components importing both wasi:cli/* and any wasi-gfx package resolve through one bundle slot.

What's in the box

WasiGfxBundle carries the configuration + backend. WasiPreview2GfxBundle is the composite the transpiler's HostPackageResolver direct-links against when both Preview2 and wasi-gfx are loaded.

Per-resource impl classes (Context, AbstractBuffer, Surface, Device, Buffer) follow the SourceGen-resource convention — parameterless ctor + Create(), with the backend pulled from WasiGfxAmbient at construction time. They live in this package and the resolver discovers them via TryFindResourceImpl.

Both engines run wasi-gfx components end-to-end:

# Interpreter component path:
wacs run --wasi-gfx --windowed my.component.wasm

# Transpiler direct-link path:
wacs run --wasip2 --wasi-gfx --windowed my.component.wasm

AddWasiGfx + AddWasiPreview2GfxBundle register everything via Microsoft.Extensions.DependencyInjection. The CLI auto-wires both at startup via the WasiPreview2RuntimeScope.ReflectivelyAddWasiGfx hook in Preview2's DI scope.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS 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.WASI.GFX.DependencyInjection:

Package Downloads
WACS.WASI.GFX.Silk

Silk.NET/SDL + wgpu-native backend for WACS.WASI.GFX. Implements IBackend for wasi:graphics-context, wasi:surface, wasi:frame-buffer, and wasi:webgpu on top of SDL2 + wgpu-native via Silk.NET. Ships as a sibling NuGet so consumers wiring a different backend don't pull SDL's or wgpu-native's binaries. Preview: tracks the wasi-gfx proposal at WASI Phase 2 — the WIT surface may change as the proposal evolves.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1-preview 52 5/16/2026