From kagents
Native AOT and trimming compatibility for .NET — IL analyzer warnings (IL2026, IL2070, IL2067, IL2072, IL3050), IsAotCompatible, DynamicallyAccessedMembers, source-generated serialization, reflection-free DI. USE FOR: resolving IL warnings, enabling AOT compilation, making libraries trim-safe. DO NOT USE FOR: general build errors (use dotnet-build-diagnosis) or runtime performance tuning (use database-performance or maui-performance).
npx claudepluginhub grexyloco/k.agents --plugin kagentsThis skill uses the workspace's default tool permissions.
Basiert auf: [dotnet/skills](https://github.com/dotnet/skills) (MIT, Microsoft .NET Team)
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Basiert auf: dotnet/skills (MIT, Microsoft .NET Team)
<PropertyGroup>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
</PropertyGroup>
Aktiviert automatisch EnableTrimAnalyzer=true und EnableAotAnalyzer=true.
dotnet build MyProject.csproj --no-incremental 2>&1 | grep 'IL[0-9]\{4\}'
| Warning | Ursache | Fix |
|---|---|---|
| IL2026 | Aufruf von [RequiresUnreferencedCode] | Aufruf vermeiden oder [UnconditionalSuppressMessage] mit Begründung |
| IL2070 | Reflection ohne [DynamicallyAccessedMembers] | Annotation am Type-Parameter hinzufügen |
| IL2067 | Unannotierter Type an annotierte Methode übergeben | [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] |
| IL2072 | Rückgabewert ohne Annotation | Annotation am Return-Type |
| IL2057 | Type.GetType(string) mit nicht-konstanter Variable | Konstante verwenden oder Pattern ändern |
| IL3050 | [RequiresDynamicCode] Aufruf | Source Generator oder Compile-Time Alternative |
[JsonSerializable(typeof(UserResponse))]
[JsonSerializable(typeof(List<UserResponse>))]
internal partial class AppJsonContext : JsonSerializerContext { }
// Nutzung
var json = JsonSerializer.Serialize(user, AppJsonContext.Default.UserResponse);
// Statt Assembly-Scanning:
builder.Services.AddSingleton<IUserService, UserService>();
// Oder Source-Generated DI (ab .NET 10)