ilspy-decompile

Comprenez les détails d'implémentation du code .NET en décompilant des assemblies. Utilisez cette compétence pour voir comment une API .NET fonctionne en interne, inspecter le code source des paquets NuGet, visualiser l'implémentation du framework ou comprendre des binaires .NET compilés.

Qu'est-ce que ilspy-decompile ?

Cette compétence permet aux agents IA (comme Claude Code, Cursor, Codex) de décompiler des assemblies .NET compilés en utilisant l'outil en ligne de commande ILSpy (ilspycmd). Elle est utile pour les développeurs souhaitant comprendre le fonctionnement interne d'une API .NET, inspecter le code source d'une bibliothèque NuGet, visualiser l'implémentation du framework .NET ou analyser des binaires compilés. La compétence prend en charge la décompilation de base, la décompilation ciblée par type, la sortie vers un dossier, et l'affichage du code IL intermédiaire. Elle nécessite le SDK .NET et l'installation de l'outil ilspycmd via dotnet tool. Elle fournit également des emplacements courants d'assemblies .NET (NuGet, runtime, SDK, sortie de build) et des conseils sur les builds modernes (ReadyToRun, trimming, AOT).

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/ilspy-decompile

Installed? Explore more Développement et programmation skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Décompilation d'assembly .NET avec ILSpy

Utilisez cette compétence pour comprendre comment le code .NET fonctionne en interne en décompilant des assemblies compilés.

Prérequis

  • SDK .NET installé
  • Outil en ligne de commande ILSpy disponible via l'une des méthodes suivantes :
    • dnx ilspycmd (si disponible dans votre SDK ou runtime)
    • dotnet tool install --global ilspycmd

Les deux formes sont présentées ci-dessous. Utilisez celle qui fonctionne dans votre environnement.

Remarque : Les options de ILSpyCmd peuvent varier légèrement selon la version. Vérifiez toujours les indicateurs pris en charge avec ilspycmd -h.

Démarrage rapide

# Décompiler un assembly vers la sortie standard
ilspycmd MyLibrary.dll
# ou
dnx ilspycmd MyLibrary.dll

# Décompiler vers un dossier de sortie
ilspycmd -o output-folder MyLibrary.dll

Emplacements courants des assemblies .NET

Paquets NuGet

~/.nuget/packages/<nom-du-paquet>/<version>/lib/<tfm>/

Bibliothèques runtime .NET

dotnet --list-runtimes

Assemblies de référence du SDK .NET

dotnet --list-sdks

Les assemblies de référence ne contiennent pas d'implémentations.

Sortie de build du projet

./bin/Debug/net8.0/<NomAssembly>.dll
./bin/Release/net8.0/publish/<NomAssembly>.dll

Flux de travail principal

  1. Identifiez ce que vous voulez comprendre
  2. Localisez l'assembly
  3. Listez les types
  4. Décompilez la cible

Commandes

Décompilation de base

ilspycmd MyLibrary.dll
ilspycmd -o ./decompiled MyLibrary.dll
ilspycmd -p -o ./project MyLibrary.dll

Décompilation ciblée

ilspycmd -t Namespace.ClassName MyLibrary.dll
ilspycmd -lv CSharp12_0 MyLibrary.dll

Affichage du code IL

ilspycmd -il MyLibrary.dll

Remarques sur les builds modernes .NET

  • Les images ReadyToRun peuvent réduire la lisibilité
  • Les builds élagués (trimmed) ou AOT peuvent omettre du code
  • Privilégiez les builds non élagués

Note légale

La décompilation d'assemblies peut être soumise à des restrictions de licence.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

akka-hosting-actor-patterns

Patterns for building entity actors with Akka.Hosting - GenericChildPerEntityParent, message extractors, cluster sharding abstraction, akka-reminders, and ITimeProvider. Supports both local testing and clustered production modes.

akka-net-aspire-configuration

Configure Akka.NET with .NET Aspire for local development and production deployments. Covers actor system setup, clustering, persistence, Akka.Management integration, and Aspire orchestration patterns.

akka-net-best-practices

Critical Akka.NET best practices including EventStream vs DistributedPubSub, supervision strategies, error handling, Props vs DependencyResolver, work distribution patterns, and cluster/local mode abstractions for testability.

akka-net-management

Akka.Management for cluster bootstrapping, service discovery (Kubernetes, Azure, Config), health checks, and dynamic cluster formation without static seed nodes.

akka-net-testing-patterns

Write unit and integration tests for Akka.NET actors using modern Akka.Hosting.TestKit patterns. Covers dependency injection, TestProbes, persistence testing, and actor interaction verification. Includes guidance on when to use traditional TestKit.

api-design

Design stable, compatible public APIs using extend-only design principles. Manage API compatibility, wire compatibility, and versioning for NuGet packages and distributed systems.

aspire-configuration

Configure Aspire AppHost to emit explicit app config via environment variables; keep app code free of Aspire clients and service discovery.

aspire-integration-testing

Write integration tests using .NET Aspire

aspire-service-defaults

Create a shared ServiceDefaults project for Aspire applications. Centralizes OpenTelemetry, health checks, resilience, and service discovery configuration across all services.

crap-analysis

Analyze code coverage and CRAP (Change Risk Anti-Patterns) scores to identify high-risk code. Use OpenCover format with ReportGenerator for Risk Hotspots showing cyclomatic complexity and untested code paths.

csharp-concurrency-patterns

Choosing the right concurrency abstraction in .NET - from async/await for I/O to Channels for producer/consumer to Akka.NET for stateful entity management. Avoid locks and manual synchronization unless absolutely necessary.

database-performance

Database access patterns for performance. Separate read/write models, avoid N+1 queries, use AsNoTracking, apply row limits, and never do application-side joins. Works with EF Core and Dapper.

dependency-injection-patterns

Organize DI registrations using IServiceCollection extension methods. Group related services into composable Add* methods for clean Program.cs and reusable configuration in tests.

dotnet-devcert-trust

Diagnose and fix .NET HTTPS dev certificate trust issues on Linux. Covers the full certificate lifecycle from generation to system CA bundle inclusion, with distro-specific guidance for Ubuntu, Fedora, Arch, and WSL2.

dotnet-local-tools

Managing local .NET tools with dotnet-tools.json for consistent tooling across development environments and CI/CD pipelines.

dotnet-project-structure

Modern .NET project structure including .slnx solution format, Directory.Build.props, central package management, SourceLink, version management with RELEASE_NOTES.md, and SDK pinning with global.json.

dotnet-slopwatch

Use Slopwatch to detect LLM reward hacking in .NET code changes. Run after every code modification to catch disabled tests, suppressed warnings, empty catch blocks, and other shortcuts that mask real problems.

efcore-patterns

Entity Framework Core best practices including NoTracking by default, query splitting for navigation collections, migration management, dedicated migration services, and common pitfalls to avoid.

mailpit-integration

Test email sending locally using Mailpit with .NET Aspire. Captures all outgoing emails without sending them. View rendered HTML, inspect headers, and verify delivery in integration tests.

marketplace-publishing

Workflow for publishing skills and agents to the dotnet-skills Claude Code marketplace. Covers adding new content, updating plugin.json, validation, and release tagging.

Skills associés