Communityコーディング&開発github.com

ilspy-decompile

.NETアセンブリを逆コンパイルして、内部実装の詳細を理解します。NuGetパッケージのソース、フレームワーク実装、コンパイル済みバイナリの調査に使用します。

ilspy-decompile とは?

このスキルは、ILSpyコマンドラインツールを使ってコンパイル済みの.NETアセンブリを逆コンパイルし、内部実装を確認するためのものです。開発者はNuGetパッケージのソースコード、.NETランタイムライブラリ、または自作プロジェクトのビルド出力を直接読むことで、APIの動作やフレームワークの実装詳細を理解できます。 対応プラットフォームは主にILSpyCmd(`ilspycmd`または`dnx ilspycmd`)で、.NET SDKがインストールされていれば即座に使用可能です。アセンブリの逆コンパイル、指定した型のみの逆コンパイル、ILコードの表示、プロジェクト出力形式での保存など、多彩なコマンドが用意されています。 このスキールは、コードリーディング、バグ調査、サードパーティ依存関係の理解、学習目的などに役立ちます。ただし、ReadyToRunイメージやトリミングビルドでは読みやすさが低下する可能性がある点や、ライセンス制約に注意する必要があります。 使い方はシンプルで、まず調査対象のアセンブリを特定し(NuGetキャッシュ、ランタイムディレクトリ、ビルド出力フォルダなど)、次に逆コンパイルコマンドを実行するだけです。開発の効率を大幅に向上させる強力なツールです。

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

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

.NETアセンブリの逆コンパイル(ILSpy)

このスキルを使用して、コンパイル済みアセンブリを逆コンパイルし、.NETコードの内部動作を理解します。

前提条件

  • .NET SDKがインストールされていること
  • ILSpyコマンドラインツールが次のいずれかで利用可能であること:
    • dnx ilspycmd(SDKまたはランタイムで利用可能な場合)
    • dotnet tool install --global ilspycmd

以下に両方の形式を示します。環境で動作する方を使用してください。

注:ILSpyCmdのオプションはバージョンによって若干異なる場合があります。 サポートされているフラグは常に ilspycmd -h で確認してください。

クイックスタート

# アセンブリを標準出力に逆コンパイル
ilspycmd MyLibrary.dll
# または
dnx ilspycmd MyLibrary.dll

# 出力フォルダに逆コンパイル
ilspycmd -o output-folder MyLibrary.dll

一般的な.NETアセンブリの場所

NuGetパッケージ

~/.nuget/packages/<package-name>/<version>/lib/<tfm>/

.NETランタイムライブラリ

dotnet --list-runtimes

.NET SDK参照アセンブリ

dotnet --list-sdks

参照アセンブリには実装が含まれていません。

プロジェクトビルド出力

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

基本ワークフロー

  1. 理解したい対象を特定する
  2. アセンブリの場所を特定する
  3. 型を一覧表示する
  4. ターゲットを逆コンパイルする

コマンド

基本逆コンパイル

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

ターゲット指定逆コンパイル

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

ILコードの表示

ilspycmd -il MyLibrary.dll

最新の.NETビルドに関する注意

  • ReadyToRunイメージは可読性を低下させる可能性があります
  • トリミングビルドやAOTビルドではコードが省略されることがあります
  • 非トリミングビルドを優先してください

法的注意

アセンブリの逆コンパイルはライセンス制限の対象となる場合があります。

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.

関連スキル