# icsharpcode/ilspy architecture

> Architecture diagram of the GitHub repository icsharpcode/ilspy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/icsharpcode/ilspy
- Repository: https://github.com/icsharpcode/ilspy

## Overview

ILSpy is a cross-platform .NET assembly browser and decompiler. The principal workflow is: a user opens an assembly, the desktop frontend organizes it into assembly lists, the decompiler reads metadata and produces C# or project output, and the UI presents navigable results. Sampled code also shows BAML/XAML handling, comparison, bookmarks, themes, command requerying, and PowerShell access. Several frontend and engine links are inferred from documented capabilities because their orchestrating source was not sampled.

Main entry points: [`ILSpy`](https://github.com/icsharpcode/ilspy/tree/master/ILSpy) (Desktop UI), [`ICSharpCode.Decompiler`](https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler) (Decompiler Core), [`ICSharpCode.BamlDecompiler/XamlDecompiler.cs`](https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.BamlDecompiler/XamlDecompiler.cs) (XAML Decompiler), [`ICSharpCode.ILSpyX/AssemblyListManager.cs`](https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.ILSpyX/AssemblyListManager.cs) (Assembly Lists)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User Frontends"]
  node_desktop["Desktop UI"]
  node_powershell["PowerShell Cmdlets"]
  node_commands["Command Routing<br/>[CommandManager.cs]"]
end

subgraph group_workspace["Assembly Workspace"]
  node_assembly_lists["Assembly Lists"]
  node_bookmarks["Bookmark Manager<br/>[BookmarkManager.cs]"]
  node_comparison["Assembly Comparison<br/>[CompareEngine.cs]"]
  node_bookmark_file["Bookmark Storage"]
end

subgraph group_engines["Decompiler Engines"]
  node_metadata["Metadata Explorer"]
  node_decompiler["Decompiler Core"]
  node_syntax_transforms["Syntax Transforms"]
  node_baml_reader["BAML Reader<br/>[BamlReader.cs]"]
  node_xaml_decompiler["XAML Decompiler<br/>[XamlDecompiler.cs]"]
  node_rewrite_passes["Rewrite Passes<br/>[Rewrite]"]
end

subgraph group_presentation["Results Presentation"]
  node_csharp_result["C&#35; Output"]
  node_project_result["Project Output"]
  node_xaml_result["XAML Output"]
  node_theme_manager["Theme Manager<br/>[ThemeManager.cs]"]
  node_editor["Code Editor"]
end

node_user(("User"))

node_user -->|"opens assembly"| node_desktop
node_user -.->|"runs cmdlet"| node_powershell
node_desktop -->|"loads assemblies"| node_assembly_lists
node_desktop -->|"routes commands"| node_commands
node_desktop -->|"requests decompilation"| node_decompiler
node_desktop -->|"requests BAML"| node_baml_reader
node_desktop -->|"starts comparison"| node_comparison
node_desktop -->|"manages bookmarks"| node_bookmarks
node_assembly_lists -->|"opens metadata"| node_metadata
node_comparison -->|"reads metadata"| node_metadata
node_decompiler -->|"applies transforms"| node_syntax_transforms
node_decompiler -->|"emits C&#35;"| node_csharp_result
node_decompiler -->|"emits project"| node_project_result
node_baml_reader -->|"parses BAML"| node_xaml_decompiler
node_xaml_decompiler -->|"rewrites markup"| node_rewrite_passes
node_xaml_decompiler -->|"emits XAML"| node_xaml_result
node_theme_manager -->|"updates colors"| node_editor
node_bookmarks -->|"persists JSON"| node_bookmark_file

click node_desktop "https://github.com/icsharpcode/ilspy/tree/master/ILSpy"
click node_powershell "https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler.PowerShell"
click node_commands "https://github.com/icsharpcode/ilspy/blob/master/ILSpy/Commands/CommandManager.cs"
click node_assembly_lists "https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.ILSpyX/AssemblyListManager.cs"
click node_bookmarks "https://github.com/icsharpcode/ilspy/blob/master/ILSpy/Bookmarks/BookmarkManager.cs"
click node_comparison "https://github.com/icsharpcode/ilspy/blob/master/ILSpy/CompareEngine.cs"
click node_metadata "https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler"
click node_decompiler "https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler"
click node_syntax_transforms "https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.Decompiler/CSharp/Transforms/IntroduceQueryExpressions.cs"
click node_baml_reader "https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.BamlDecompiler/Baml/BamlReader.cs"
click node_xaml_decompiler "https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.BamlDecompiler/XamlDecompiler.cs"
click node_rewrite_passes "https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.BamlDecompiler/Rewrite"
click node_project_result "https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler"
click node_theme_manager "https://github.com/icsharpcode/ilspy/blob/master/ILSpy/Themes/ThemeManager.cs"
click node_editor "https://github.com/icsharpcode/ilspy/tree/master/ILSpy"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_desktop,node_powershell,node_commands,node_user toneBlue
class node_assembly_lists,node_bookmarks,node_comparison,node_bookmark_file toneAmber
class node_metadata,node_decompiler,node_syntax_transforms,node_baml_reader,node_xaml_decompiler,node_rewrite_passes toneMint
class node_csharp_result,node_project_result,node_xaml_result,node_theme_manager,node_editor toneRose
```

## Components

### User Frontends

- [Desktop UI](https://github.com/icsharpcode/ilspy/tree/master/ILSpy): `ILSpy`
- [PowerShell Cmdlets](https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler.PowerShell): `ICSharpCode.Decompiler.PowerShell`
- [Command Routing](https://github.com/icsharpcode/ilspy/blob/master/ILSpy/Commands/CommandManager.cs): `ILSpy/Commands/CommandManager.cs`

### Assembly Workspace

- [Assembly Lists](https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.ILSpyX/AssemblyListManager.cs): `ICSharpCode.ILSpyX/AssemblyListManager.cs`
- [Bookmark Manager](https://github.com/icsharpcode/ilspy/blob/master/ILSpy/Bookmarks/BookmarkManager.cs): `ILSpy/Bookmarks/BookmarkManager.cs`
- [Assembly Comparison](https://github.com/icsharpcode/ilspy/blob/master/ILSpy/CompareEngine.cs): `ILSpy/CompareEngine.cs`
- **Bookmark Storage**

### Decompiler Engines

- [Metadata Explorer](https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler): `ICSharpCode.Decompiler`
- [Decompiler Core](https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler): `ICSharpCode.Decompiler`
- [Syntax Transforms](https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.Decompiler/CSharp/Transforms/IntroduceQueryExpressions.cs): `ICSharpCode.Decompiler/CSharp/Transforms/IntroduceQueryExpressions.cs`
- [BAML Reader](https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.BamlDecompiler/Baml/BamlReader.cs): `ICSharpCode.BamlDecompiler/Baml/BamlReader.cs`
- [XAML Decompiler](https://github.com/icsharpcode/ilspy/blob/master/ICSharpCode.BamlDecompiler/XamlDecompiler.cs): `ICSharpCode.BamlDecompiler/XamlDecompiler.cs`
- [Rewrite Passes](https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.BamlDecompiler/Rewrite): `ICSharpCode.BamlDecompiler/Rewrite`

### Results Presentation

- **C# Output**
- [Project Output](https://github.com/icsharpcode/ilspy/tree/master/ICSharpCode.Decompiler): `ICSharpCode.Decompiler`
- **XAML Output**
- [Theme Manager](https://github.com/icsharpcode/ilspy/blob/master/ILSpy/Themes/ThemeManager.cs): `ILSpy/Themes/ThemeManager.cs`
- [Code Editor](https://github.com/icsharpcode/ilspy/tree/master/ILSpy): `ILSpy`

### Other components

- **User**

## Connections

- User → Desktop UI: opens assembly
- User → PowerShell Cmdlets: runs cmdlet
- Desktop UI → Assembly Lists: loads assemblies
- Desktop UI → Command Routing: routes commands
- Desktop UI → Decompiler Core: requests decompilation
- Desktop UI → BAML Reader: requests BAML
- Desktop UI → Assembly Comparison: starts comparison
- Desktop UI → Bookmark Manager: manages bookmarks
- Assembly Lists → Metadata Explorer: opens metadata
- Assembly Comparison → Metadata Explorer: reads metadata
- Decompiler Core → Syntax Transforms: applies transforms
- Decompiler Core → C# Output: emits C#
- Decompiler Core → Project Output: emits project
- BAML Reader → XAML Decompiler: parses BAML
- XAML Decompiler → Rewrite Passes: rewrites markup
- XAML Decompiler → XAML Output: emits XAML
- Theme Manager → Code Editor: updates colors
- Bookmark Manager → Bookmark Storage: persists JSON
