dotnet-aot-architecture

Guide .NET 8 application architecture for Native AOT with source generators.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-aot-architecture-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-aot-architecture
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-aot-architecture
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-aot-architecture-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides developers in architecting .NET applications specifically for Ahead-of-Time (AOT) compilation, ensuring compatibility and performance by avoiding reflection-based patterns.

Core Features & Use Cases

  • AOT-Safe Design: Recommends source generators over reflection for DI, serialization, and logging.
  • Library Compatibility: Assesses and guides the selection of AOT-compatible libraries.
  • Use Case: When building a new .NET 8+ microservice intended for Native AOT deployment, use this Skill to ensure all architectural choices, from dependency injection to data serialization, are AOT-compatible from the start.

Quick Start

Architect a new .NET 8 application for Native AOT deployment, focusing on source generators and explicit DI.

Frequently Asked Questions about dotnet-aot-architecture

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

FAQPage Schema
How do I design .NET applications for Native AOT compilation?

Migrating to Native AOT involves replacing reflection-heavy codebases with source generators for dependency injection and serialization. This Skill guides adopting .NET 8+ best practices to resolve AOT compilation challenges during migration.

How does source generation work with AOT-safe dependency injection?

AOT-safe dependency injection uses source generators to provide compile-time registration and resolution rather than runtime reflection. This Skill recommends explicit DI patterns compatible with .NET 8+ Native AOT compilation.

Can I use reflection-heavy libraries with .NET Native AOT?

Reflection-heavy libraries are not compatible with Native AOT and require replacement or architectural adaptation. This Skill assesses library compatibility and guides selecting AOT-safe alternatives for your .NET 8+ applications.

What are the limitations of Native AOT for .NET 8+ microservices?

Native AOT in .NET 8+ limits dynamic reflection, runtime code generation, and incompatible serialization libraries. This Skill helps navigate these constraints by recommending source generators and explicit compile-time architectural patterns.

When do I need source generators for .NET serialization?

You need source generators for .NET serialization when building Native AOT applications to ensure compile-time data binding without reflection. This Skill guides selecting AOT-compatible serialization patterns for your architecture.