dotnet-aot-wasm

Configure AOT compilation, trimming, and lazy loading for .NET WebAssembly apps.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-aot-wasm-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-aot-wasm
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-aot-wasm
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-aot-wasm-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the critical tradeoff between download size and runtime speed for .NET WebAssembly applications, enabling developers to achieve optimal performance for their Blazor and Uno WASM projects.

Core Features & Use Cases

  • AOT Compilation: Compiles .NET IL to native WebAssembly for faster execution.
  • Size vs. Speed Tradeoff Analysis: Guides decisions on when to use AOT, trimming, and lazy loading.
  • Lazy Loading: Reduces initial download size by deferring assembly loading.
  • Brotli Compression: Optimizes transfer size for WASM artifacts.
  • Use Case: Optimize a Blazor WASM application with a large codebase by selectively AOT-compiling core modules while lazy-loading less critical features, ensuring a fast startup and responsive user experience.

Quick Start

Enable AOT compilation for your Blazor WASM project by setting <RunAOTCompilation>true</RunAOTCompilation> in your .csproj file and publishing with dotnet publish -c Release.

Frequently Asked Questions about dotnet-aot-wasm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable AOT compilation for Blazor WebAssembly?

Enable AOT compilation for Blazor WebAssembly by setting `<RunAOTCompilation>true</RunAOTCompilation>` in your .csproj file, then publish the application using the `dotnet publish -c Release` command to generate optimized native WASM.

What is the download size versus execution speed tradeoff for .NET WASM AOT?

The tradeoff for .NET WASM AOT involves balancing larger initial download sizes against significantly faster runtime execution speed, managing this by selectively applying AOT compilation, assembly trimming, and lazy loading to optimize delivery.

Can I use selective AOT compilation and lazy loading for Uno WASM applications?

Yes, you can optimize Uno WASM applications by selectively AOT-compiling core modules while deferring the loading of less critical assemblies, minimizing initial download size and ensuring fast startup times.

How does Brotli pre-compression optimize WebAssembly transfer size?

Brotli pre-compression optimizes WebAssembly transfer size by efficiently compressing WASM artifacts before delivery, significantly reducing the network payload required to download the application to the client browser.

When should I not use AOT compilation for .NET WebAssembly?

You should avoid AOT compilation for .NET WebAssembly when the increased application download size severely impacts startup time, particularly for large codebases where selectively applying trimming and lazy loading is more beneficial.