NetWasm.Sdk 0.12.2

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
<Sdk Name="NetWasm.Sdk" Version="0.12.2" />
                    
For projects that support Sdk, copy this XML node into the project file to reference the package.
#:sdk NetWasm.Sdk@0.12.2
                    
#:sdk 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.

NetWasm.Sdk

Arguments supplied through NetWasmArgument items or dotnet run -- ... reach Main(string[] args) unchanged, with configured items before invocation values. SDK-generated local and worker requests supply the logical assembly name as the program-name entry in the underlying WASI command line. Environment.GetCommandLineArgs() includes that entry; Main does not. Browser callers constructing Hosting requests supply the complete WASI argument vector themselves, including its program-name entry.

NetWasm.Sdk contains the project-SDK implementation for the current netwasm0.1 profile. It composes Microsoft.NET.Sdk and maps the user-facing alias to the tested NetWasm identity.

Executable projects use restored, platform-neutral NetWasm.Toolchain, NetWasm.Hosting, and NetWasm.Hosting.Build packages. They also restore one NetWasm.HostTools.<host RID> package containing the pinned Node, LLD and Binaryen executables for the development host. The SDK validates those tools before building. The platform-neutral wasm-tools module is restored through NetWasm.Toolchain; Wasmtime is optional and is not part of the standard build, run or publish path. The SDK creates a manifest-complete local deployment and execution request for dotnet run; dotnet publish copies that exact portable closure or, with -p:NetWasmPublishTarget=browser, emits the browser-selected closure. Release JavaScript is minified by default.

Plain libraries do not restore host tools. Their runnable consumers select their own development host package. Host tools never enter the application deployment or a library's dependency graph.

Static native requirements

A project can declare prebuilt WebAssembly archives using ordinary items:

<ItemGroup>
  <NativeLibrary Include="native/wasm32/libexample.a"
                 NetWasmLibraryName="example" WasmTarget="wasm32" />
  <NativeLibrary Include="native/wasm64/libexample.a"
                 NetWasmLibraryName="example" WasmTarget="wasm64" />
</ItemGroup>

All three fields are required. NetWasmLibraryName matches the logical import name exactly; it does not need an .a suffix. There is no dynamic-library loading or library-name filesystem search. Only regular .a archives are accepted, with matching WebAssembly target and supported features.

Source libraries forward these requirements through managed ProjectReference edges. Relative paths are resolved in the declaring project, not the consuming root. Libraries do not compile, hash or copy archives during collection and do not select host tools or permissions. Applications and test executables use the same collection. Build-only and disabled reference edges do not contribute requirements, including requirements from their descendants. A metadata query still runs when BuildProjectReferences=false; it consumes the normal restored project graph without rebuilding referenced assemblies.

Packages can contribute the same items through ordinary package-relative buildTransitive targets. The executable root selects providers for reached native calls and its target width. Identical contributions can coalesce; conflicting providers fail. Unused and other-width archive paths are not opened. Archive content, not just timestamps, participates in native materialization's cache identity.

Source-project requirements arrive during target execution. To customize those items, use a normal target after collection and before the getter:

<Target Name="CustomizeNativeLibraries" BeforeTargets="NetWasmGetNativeLibraries">
  <ItemGroup>
    <NativeLibrary Remove="@(NativeLibrary)"
                   Condition="'%(NativeLibrary.NetWasmLibraryName)' == 'example'" />
    <NativeLibrary Include="native/custom/libexample.a"
                   NetWasmLibraryName="example" WasmTarget="$(NetWasmTarget)" />
  </ItemGroup>
</Target>

An evaluation-time Remove cannot remove source requirements that have not arrived yet. There is no separate override precedence rule.

The compiler/runtime layer supplies componentization through the NetWasmComponentizeDependsOn target seam. It receives the core module, WIT, interop, and runtime inputs through @(NetWasmComponentInput) and @(NetWasmComponentRuntime), and must produce both NetWasmOutputPath and NetWasmComponentManifestPath. A missing provider is a loud build error. This keeps compiler and runtime policy out of the SDK while allowing a runtime-tier package to plug in without changing project files.

Raw module qualification can set -p:NetWasmRawWasm=true. This emits the managed core module and materialized runtime module, but skips SDK-owned componentization so an external raw-module linker can consume the standard NetWasmComponentInput and NetWasmComponentRuntime contract. The default false value preserves executable component builds. Raw output is independent of the entry point: an asynchronous Main works with component or raw output. Reachable application-owned [JSImport] calls require raw output and an exact application provider. See the entry-contract matrix.

NetWasm library projects intentionally reject dotnet run and dotnet publish for the netwasm0.1 inner build. Desktop inner builds of a dual-target library continue to use the stock SDK.

The SDK-owned pack boundary is selected only for projects declaring netwasm0.1. Desktop-only projects continue through the stock NuGet pack targets.

See the repository's package-consumer quickstart for supported hosts, restore behavior and application templates.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.15.2 0 11/22/2026
0.15.2-preview.1 0 11/22/2026
0.15.1 136 11/21/2026
0.15.1-preview.2 48 11/21/2026
0.15.0 130 11/20/2026
0.15.0-preview.1 40 11/20/2026
0.14.2 373 11/15/2026
0.14.2-preview.2 56 11/15/2026
0.14.1 94 11/15/2026
0.14.1-preview.1 62 11/15/2026
0.14.0 162 11/14/2026
0.14.0-preview.2 64 11/14/2026
0.13.0 204 11/13/2026
0.13.0-preview.2 54 11/13/2026
0.12.2 158 11/11/2026
0.12.2-preview.1 58 11/11/2026
0.12.1 91 11/10/2026
0.12.1-preview.2 61 11/10/2026
0.12.0 167 11/10/2026
0.12.0-preview.5 54 11/10/2026
Loading failed