# dotnet/runtime architecture

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

- Interactive diagram: https://gitdiagram.com/dotnet/runtime
- Repository: https://github.com/dotnet/runtime

## Overview

This repository is the .NET runtime, class libraries, and shared host described by the README. The graph highlights runtime services, managed libraries, diagnostics, and WebAssembly hosting; it is not a complete map of every platform implementation. Relationships are included only where the README or supplied source excerpts and SOURCE INDEX support them; unsampled subsystems are represented without guessed call paths.

Main entry points: [`src/mono/wasm/host/JSEngineHost.cs`](https://github.com/dotnet/runtime/blob/main/src/mono/wasm/host/JSEngineHost.cs) (JavaScript engine host), [`src/native/eventpipe/ep-buffer-manager.c`](https://github.com/dotnet/runtime/blob/main/src/native/eventpipe/ep-buffer-manager.c) (EventPipe buffers), [`src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs`](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs) (Dictionary), [`src/libraries/System.Linq/src/System/Linq/Contains.cs`](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Linq/src/System/Linq/Contains.cs) (LINQ Contains)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Core"]
  node_coreclr["CoreCLR runtime"]
  node_assembly_binding["Assembly binding"]
  node_reflection["Reflection<br/>[RuntimeAssembly.cs]"]
  node_mono_runtime["Mono runtime<br/>[memory-manager.c]"]
  node_wasm_runtime["WebAssembly runtime<br/>[JSEngineHost.cs]"]
end

subgraph group_libraries["Managed Libraries"]
  node_collections["Dictionary<br/>[Dictionary.cs]"]
  node_linq["LINQ Contains<br/>[Contains.cs]"]
  node_equality["Equality comparer"]
  node_tasks["Task async work<br/>[Task.cs]"]
  node_cancellation["Cancellation token"]
  node_isolated_storage["Isolated storage"]
  node_composition["Composition imports"]
end

subgraph group_diagnostics["Diagnostics"]
  node_debugger["Debugger engine<br/>[debugger-engine.c]"]
  node_debug_transport["Debugger transport"]
  node_crash_dumps["Crash dumps<br/>[createdumpmain.cpp]"]
  node_eventpipe_buffers["EventPipe buffers"]
end

subgraph group_hosting["Hosting"]
  node_wasm_host["JavaScript engine host<br/>[JSEngineHost.cs]"]
  node_host_arguments["Host arguments"]
end

node_app_user(("Application developer"))
node_js_engine["JavaScript engine"]
node_runtime_libraries_host["Runtime, libraries, and shared host"]

node_app_user -->|"uses"| node_runtime_libraries_host
node_runtime_libraries_host -->|"includes runtime"| node_coreclr
node_runtime_libraries_host -->|"includes runtime"| node_mono_runtime
node_runtime_libraries_host -->|"includes libraries"| node_collections
node_runtime_libraries_host -->|"includes shared host"| node_wasm_host
node_linq -->|"compares elements"| node_equality
node_tasks -->|"checks cancellation"| node_cancellation
node_composition -->|"stores imports"| node_collections
node_wasm_host -->|"parses arguments"| node_host_arguments
node_wasm_host -->|"launches process"| node_js_engine
node_eventpipe_buffers -->|"writes events"| node_eventpipe_buffers

click node_assembly_binding "https://github.com/dotnet/runtime/blob/main/src/coreclr/binder/defaultassemblybinder.cpp"
click node_reflection "https://github.com/dotnet/runtime/blob/main/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs"
click node_mono_runtime "https://github.com/dotnet/runtime/blob/main/src/mono/mono/metadata/memory-manager.c"
click node_wasm_runtime "https://github.com/dotnet/runtime/blob/main/src/mono/wasm/host/JSEngineHost.cs"
click node_collections "https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs"
click node_linq "https://github.com/dotnet/runtime/blob/main/src/libraries/System.Linq/src/System/Linq/Contains.cs"
click node_equality "https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs"
click node_tasks "https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs"
click node_cancellation "https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Threading/CancellationToken.cs"
click node_isolated_storage "https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.cs"
click node_composition "https://github.com/dotnet/runtime/blob/main/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportEngine.PartManager.cs"
click node_debugger "https://github.com/dotnet/runtime/blob/main/src/mono/mono/component/debugger-engine.c"
click node_debug_transport "https://github.com/dotnet/runtime/blob/main/src/coreclr/debug/di/dbgtransportpipeline.cpp"
click node_crash_dumps "https://github.com/dotnet/runtime/blob/main/src/coreclr/debug/createdump/createdumpmain.cpp"
click node_eventpipe_buffers "https://github.com/dotnet/runtime/blob/main/src/native/eventpipe/ep-buffer-manager.c"
click node_wasm_host "https://github.com/dotnet/runtime/blob/main/src/mono/wasm/host/JSEngineHost.cs"
click node_host_arguments "https://github.com/dotnet/runtime/blob/main/src/mono/wasm/host/JSEngineArguments.cs"

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_coreclr,node_assembly_binding,node_reflection,node_mono_runtime,node_wasm_runtime toneBlue
class node_collections,node_linq,node_equality,node_tasks,node_cancellation,node_isolated_storage,node_composition toneAmber
class node_debugger,node_debug_transport,node_crash_dumps,node_eventpipe_buffers toneMint
class node_wasm_host,node_host_arguments toneRose
class node_app_user,node_js_engine,node_runtime_libraries_host toneIndigo
```

## Components

### Runtime Core

- **CoreCLR runtime**
- [Assembly binding](https://github.com/dotnet/runtime/blob/main/src/coreclr/binder/defaultassemblybinder.cpp): `src/coreclr/binder/defaultassemblybinder.cpp`
- [Reflection](https://github.com/dotnet/runtime/blob/main/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs): `src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs`
- [Mono runtime](https://github.com/dotnet/runtime/blob/main/src/mono/mono/metadata/memory-manager.c): `src/mono/mono/metadata/memory-manager.c`
- [WebAssembly runtime](https://github.com/dotnet/runtime/blob/main/src/mono/wasm/host/JSEngineHost.cs): `src/mono/wasm/host/JSEngineHost.cs`

### Managed Libraries

- [Dictionary](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs): `src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs`
- [LINQ Contains](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Linq/src/System/Linq/Contains.cs): `src/libraries/System.Linq/src/System/Linq/Contains.cs`
- [Equality comparer](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs): `src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs`
- [Task async work](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs): `src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs`
- [Cancellation token](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Threading/CancellationToken.cs): `src/libraries/System.Private.CoreLib/src/System/Threading/CancellationToken.cs`
- [Isolated storage](https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.cs): `src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFile.cs`
- [Composition imports](https://github.com/dotnet/runtime/blob/main/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportEngine.PartManager.cs): `src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportEngine.PartManager.cs`

### Diagnostics

- [Debugger engine](https://github.com/dotnet/runtime/blob/main/src/mono/mono/component/debugger-engine.c): `src/mono/mono/component/debugger-engine.c`
- [Debugger transport](https://github.com/dotnet/runtime/blob/main/src/coreclr/debug/di/dbgtransportpipeline.cpp): `src/coreclr/debug/di/dbgtransportpipeline.cpp`
- [Crash dumps](https://github.com/dotnet/runtime/blob/main/src/coreclr/debug/createdump/createdumpmain.cpp): `src/coreclr/debug/createdump/createdumpmain.cpp`
- [EventPipe buffers](https://github.com/dotnet/runtime/blob/main/src/native/eventpipe/ep-buffer-manager.c): `src/native/eventpipe/ep-buffer-manager.c`

### Hosting

- [JavaScript engine host](https://github.com/dotnet/runtime/blob/main/src/mono/wasm/host/JSEngineHost.cs): `src/mono/wasm/host/JSEngineHost.cs`
- [Host arguments](https://github.com/dotnet/runtime/blob/main/src/mono/wasm/host/JSEngineArguments.cs): `src/mono/wasm/host/JSEngineArguments.cs`

### Other components

- **Application developer**
- **JavaScript engine**
- **Runtime, libraries, and shared host**

## Connections

- Application developer → Runtime, libraries, and shared host: uses
- Runtime, libraries, and shared host → CoreCLR runtime: includes runtime
- Runtime, libraries, and shared host → Mono runtime: includes runtime
- Runtime, libraries, and shared host → Dictionary: includes libraries
- Runtime, libraries, and shared host → JavaScript engine host: includes shared host
- LINQ Contains → Equality comparer: compares elements (evidence: `src/libraries/System.Linq/src/System/Linq/Contains.cs`)
- Task async work → Cancellation token: checks cancellation (evidence: `src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs`)
- Composition imports → Dictionary: stores imports (evidence: `src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportEngine.PartManager.cs`)
- JavaScript engine host → Host arguments: parses arguments (evidence: `src/mono/wasm/host/JSEngineHost.cs`)
- JavaScript engine host → JavaScript engine: launches process (evidence: `src/mono/wasm/host/JSEngineHost.cs`)
- EventPipe buffers → EventPipe buffers: writes events (evidence: `src/native/eventpipe/ep-buffer-manager.c`)
