AAotAnywhere
TECHNICAL NOTE — v1.1.0

Cross-OS Native AOT,
without the asterisk.

Native AOT refuses to link for another OS. AotAnywhere removes that limit — Zig supplies the linker and sysroot, so dotnet publish -r <rid>resolves for Linux, macOS and Windows from any supported host.

Install from NuGet →Source
STDOUT — BEFORE / AFTER
$ dotnet publish -r linux-x64
error : Cross-OS native compilation is not supported.
# + <Sdk Name="StuDev.AotAnywhere" />
$ dotnet publish -r linux-x64
✓ published · stripped · 4.2 MB
FIG. 01 — HOST × TARGET MATRIX5 HOSTS × 10 RIDS
BUILDS ONRUNS ONWindowsx64 · x86 · arm64macOSarm64 · x64Linuxx64 · arm64AotAnywheredotnet publish -r <rid>NuGet package · Zig built inLinuxglibcmusllinux-x64linux-arm64linux-armlinux-musl-x64linux-musl-arm64linux-musl-armmacOSosx-arm64 · osx-x64Windowswin-x64 · win-arm64✓ Every combination CI-tested — 6 hosts × 10 target RIDs, every binary built and executed on its target platform
§01 — QUICK START
01.1 — inside <Project>
<Project Sdk="Microsoft.NET.Sdk">

  <Sdk Name="StuDev.AotAnywhere" Version="1.1.0" />
01.2 — publish for a RID
$ dotnet publish -r linux-x64
$ dotnet publish -r osx-arm64
$ dotnet publish -r win-x64
// no cross toolchains · no LLVM · no system packages · symbol stripping built in
§02 — SUPPORTED PLATFORMS
OS
HOST
TARGET RIDS
Linux
x64 · arm64
linux-x64 · linux-arm64 · linux-arm · linux-musl-x64 · linux-musl-arm64 · linux-musl-arm
macOS
x64 · arm64
osx-arm64 · osx-x64
Windows
x86 · x64 · arm64
win-x64 · win-arm64
// armv7 (linux-arm, linux-musl-arm) → net9.0+ · macOS output needs signing before distribution
§03 — HOW IT WORKS
01

Zig is the linker & sysroot

Links run directly through zig cc, which also supplies the sysroot for every target — the mechanism that makes cross-OS AOT possible.

02

Brings everything with it

No cross toolchains or system packages on the build machine. Bundled Apple sysroot stubs and symbol stripping — no LLVM install.

03

Restored via the Sdk form

SDK props evaluate during restore, so the host-specific Zig package is fetched the first time with no further setup.

04

Validated end to end

Every change builds all 10 target RIDs from Windows, Linux and macOS hosts and executes each binary on its target platform; the full matrix of 6 hosts × 10 target RIDs runs on demand.