dotnet-diagnostics-core
0.24.0
dotnet add package dotnet-diagnostics-core --version 0.24.0
NuGet\Install-Package dotnet-diagnostics-core -Version 0.24.0
<PackageReference Include="dotnet-diagnostics-core" Version="0.24.0" />
<PackageVersion Include="dotnet-diagnostics-core" Version="0.24.0" />
<PackageReference Include="dotnet-diagnostics-core" />
paket add dotnet-diagnostics-core --version 0.24.0
#r "nuget: dotnet-diagnostics-core, 0.24.0"
#:package dotnet-diagnostics-core@0.24.0
#addin nuget:?package=dotnet-diagnostics-core&version=0.24.0
#tool nuget:?package=dotnet-diagnostics-core&version=0.24.0
dotnet-diagnostics-core
The transport-agnostic .NET diagnostics engine behind the
dotnet-diagnostics-mcp MCP server and
the dotnet-diagnostics-cli. It attaches to a live .NET process over the runtime diagnostic IPC
socket and turns raw EventPipe / ClrMD / TraceEvent streams into structured results. Those normal
paths require no target code changes or prior instrumentation. The explicit exception is
MethodParameterCaptureUseCases: it performs a privileged dynamic attach of vendored
dotnet-monitor profilers plus a startup hook and temporarily ReJIT-instruments an allowlist of
methods; hosts must expose that sensitive capability only behind an explicit authorization policy.
This package exists so other hosts can call the same engine in-process, without shelling out to
a tool. The first such consumer is the BenchmarkDotNet diagnoser
(dotnet-diagnostics-benchmarkdotnet).
dotnet add package dotnet-diagnostics-core
Target framework:
net10.0. Platform: the engine attaches over the diagnostic IPC socket; live ClrMD memory readers (heap/thread snapshots, method bytes, module bytes) additionally needCAP_SYS_PTRACEon Linux and the same UID as the target. Process dumps write through diagnostic IPC and do not require that kernel capability. See the repo docs for the deployment matrix.
Supported public surface (Pattern B — curated facade)
⚠️ Pre-1.0 / unstable. While this package is versioned
0.xit carries no SemVer API stability guarantee. Only the entry points listed below are intended for external use; every other public type is an implementation detail that will be internalized incrementally and may change or disappear without a major-version bump. Depend on the facade, not on the plumbing.
The supported entry points are the static use-case classes; each method returns a
DiagnosticResult<T> envelope (success payload, DiagnosticError, and NextActionHints):
| Use-case class | What it does |
|---|---|
ProcessInspectionUseCases |
Discover .NET processes; process / capability / container / runtime-config / triage views. |
EventCollectionUseCases |
EventPipe collection: counters, exceptions, GC, GC DATAS, logs, JIT, threadpool, contention, db, activities, event-source, event catalog. |
HeapInspectionUseCases |
Live or dump heap walk + drilldown handles. |
ProcessDumpUseCases |
Write a process dump (Mini / Triage / WithHeap / Full). |
ByteMaterializationUseCases |
Stream module (PE/PDB) or dump bytes. |
MethodParameterCaptureUseCases |
Explicit dynamic-profiler capture of allowlisted method parameters on supported CoreCLR targets. |
Supporting types that are part of the facade because the use-cases return or accept them:
DiagnosticResult/DiagnosticResult<T>,DiagnosticError,NextActionHint— the result envelope.- The per-collector snapshot/result records returned by the use-cases (e.g.
CounterSnapshot,GcSummary,ContentionSnapshot, …).
Example
using DotnetDiagnostics.Core.UseCases;
// Snapshot EventCounters for ~5s from a target PID.
DiagnosticResult<CounterSnapshot> result =
await EventCollectionUseCases.SnapshotCounters(processId: pid, durationSeconds: 5);
if (result.IsSuccess)
{
foreach (var hint in result.Hints)
Console.WriteLine(hint.Message);
}
Not in scope for this package
- The MCP tool surface, HTTP transport and bearer auth live in
dotnet-diagnostics-mcp. - The one-shot / REPL command line lives in
dotnet-diagnostics-cli.
License
MIT — see the repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Identity (>= 1.21.0)
- Microsoft.Diagnostics.NETCore.Client (>= 0.2.661903)
- Microsoft.Diagnostics.Runtime (>= 4.0.732401)
- Microsoft.Diagnostics.Tracing.TraceEvent (>= 3.2.2)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging (>= 10.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on dotnet-diagnostics-core:
| Package | Downloads |
|---|---|
|
dotnet-diagnostics-benchmarkdotnet
A BenchmarkDotNet IDiagnoser that attaches the dotnet-diagnostics engine in-process to a benchmark's child process and captures EventPipe perf indicators (GC, contention, thread pool, exceptions, JIT, counters, …) as JSON artifacts plus a per-run "biggest offenders" report. Tag benchmark methods with [DiagnosticKind] and add [DotnetDiagnosticsDiagnoser] to the benchmark class. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.24.0 | 786 | 8/19/2026 |
| 0.23.0 | 117 | 8/13/2026 |
| 0.22.0 | 122 | 8/1/2026 |
| 0.21.0 | 120 | 7/30/2026 |
| 0.20.0 | 119 | 7/29/2026 |
| 0.19.0 | 120 | 7/21/2026 |
| 0.18.0 | 123 | 7/20/2026 |
| 0.17.0 | 129 | 7/7/2026 |
| 0.16.0 | 123 | 7/2/2026 |
| 0.15.0 | 133 | 7/2/2026 |
| 0.14.0 | 161 | 6/11/2026 |
| 0.13.0 | 134 | 6/10/2026 |
| 0.12.0 | 145 | 6/10/2026 |
| 0.11.0 | 137 | 6/9/2026 |