🎯

dotnet-aot-analysis

🎯Skill

from im5tu/dotnet-skills

VibeIndex|
What it does

Analyzes and configures .NET projects for Native AOT compatibility, applying source generators and optimizing AOT deployment settings.

πŸ“¦

Part of

im5tu/dotnet-skills(10 items)

dotnet-aot-analysis

Installation

Quick InstallInstall with npx
npx skills add im5tu/dotnet-skills
πŸ“– Extracted from docs: im5tu/dotnet-skills
1Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

Analyzes and configures a .NET project or solution for Native AOT compatibility. Orchestrates source generator skills and applies AOT settings.

Overview

Analyze and configure a .NET project or solution for Native AOT compatibility, applying source generators and AOT settings.

When to Use

  • User wants to enable Native AOT
  • User wants to check AOT compatibility
  • User wants to optimize for AOT deployment

Workflow

Step 1: Ask Scope

Ask user: Solution-wide or Specific project(s)?

Step 2: Detect Project Types

For each project:

  • Check for ASP.NET Core (Microsoft.AspNetCore refs, WebApplication, CreateBuilder)
  • Check for Blazor Server (Microsoft.AspNetCore.Components.Server)
  • Check for MVC (AddControllersWithViews, AddMvc)

Step 3: Warn About Unsupported Scenarios

| Scenario | Documentation |

|----------|---------------|

| Blazor Server | https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot |

| MVC | https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot |

| Session state | https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot |

| SPA middleware | https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot |

Ask user: Continue with compatible projects or abort?

Step 4: Invoke Sub-Skills

For each compatible project, invoke:

  1. dotnet-source-gen-json - JSON serialization AOT readiness (includes polymorphic types)
  2. dotnet-source-gen-options-validation - Options pattern AOT readiness
  3. dotnet-source-gen-regex - Regex AOT readiness
  4. dotnet-source-gen-logging - Logging AOT readiness

Step 5: Configure AOT Settings

If solution-wide:

Check for src/Directory.Build.props, otherwise use solution root. Add/merge:

```xml

true

true

true

true

```

If project-specific:

Add to each .csproj:

```xml

true

```

Step 6: ASP.NET Core Specific

For ASP.NET Core projects:

  • Recommend CreateSlimBuilder() over CreateBuilder()
  • Enable Request Delegate Generator (RDG) for Minimal APIs:

```xml

true

```

  • System.Text.Json: Handled by dotnet-source-gen-json skill
  • Warn about HTTPS/HTTP3 if needed (not included in CreateSlimBuilder)
  • Ask user if they want to see generated code. If so, add true

Step 7: Verify

Run dotnet build and check for AOT warnings.

Key Documentation Links

| Topic | URL |

|-------|-----|

| Native AOT Overview | https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot |

| ASP.NET Core AOT | https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot |

| Request Delegate Generator | https://learn.microsoft.com/en-us/aspnet/core/fundamentals/aot/request-delegate-generator/rdg |

| AOT Limitations | https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/?tabs=windows#limitations-of-native-aot-deployment |

| Trimming Libraries | https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming |

Notes

  • Requires .NET 7+ (ASP.NET Core support requires .NET 8+)
  • ASP.NET Core: Use CreateSlimBuilder() for optimal size
  • Minimal APIs: Enable Request Delegate Generator (RDG) for optimal AOT performance
  • Eliminate runtime reflection from hot paths; use source generators where reflection would otherwise be required
  • System.Text.Json: Register all types in JsonSerializerContext

More from this repository9

🎯
dotnet-source-gen-regex🎯Skill

Converts .NET regex instances to compile-time source-generated implementations for improved performance and AOT compatibility.

🎯
dotnet-enable-testing-platform🎯Skill

Enables and configures testing platforms and frameworks for .NET projects, streamlining test setup and infrastructure.

🎯
dotnet-source-gen-logging🎯Skill

Transforms .NET logging calls to use LoggerMessage source generator for high-performance, AOT-compatible logging with zero boxing overhead.

🎯
dotnet-json-polymorphic🎯Skill

Converts JSON payloads with polymorphic type handling, enabling dynamic deserialization of complex .NET object hierarchies.

🎯
dotnet-source-gen-json🎯Skill

Generates JSON serialization and deserialization code for .NET classes using source generators, improving performance and reducing boilerplate.

🎯
dotnet-centralise-packages🎯Skill

Centralizes NuGet package versions across .NET projects by creating a single `Directory.Packages.props` file and updating project references.

🎯
dotnet-enable-autocomplete🎯Skill

Enables dotnet CLI tab autocomplete across multiple shells, automatically detecting .NET version and configuring shell-specific completion scripts.

🎯
dotnet-source-gen-options-validation🎯Skill

Converts options validation to compile-time source generator for AOT-compatible, reflection-free validation at startup.

🎯
dotnet-update-packages🎯Skill

Automatically lists and updates outdated NuGet packages in .NET projects, guiding users through dependency management with interactive confirmation.