.NET Diagnostics for VS CodeInvestigate .NET performance problems without leaving VS Code: watch runtime counters, GC pauses and EventPipe events, find CPU hotspots, inspect heap and thread snapshots, and analyze existing dumps. What you can do
Saved comparisons start only from a successfully loaded artifact. They name that artifact before selection and let you explicitly keep it as candidate (right) or reverse it into baseline (left). The picker searches up to the latest 500 catalog entries, groups matching, unknown and known family-mismatch choices without replacing CLI validation, and keeps an out-of-window current artifact available. Results preserve side identities, collection quality and the CLI's structured compatibility reasons. Comparisons summarize numeric deltas as up/down/flat/unavailable, not performance verdicts. The
extension uses the CLI's historical comparison contract (compatibility and measurement semantics),
not journey verdict labels such as Live CPU comparison is distinct from that saved-capture flow. It requires the CLI's advertised
Get startedRequires VS Code 1.96+ and the .NET 10 runtime, or a self-contained CLI. Install
Already installed? Run
The empty .NET Processes view links to Open Getting Started, Check Environment, and Refresh Processes. A filter with no matches offers Clear Filter, distinct from no discoverable diagnostic endpoints. Active target identifies the current panel target for both tree and picker selection; a remembered hint never means an active attachment. Saved Captures labels the CLI catalog on this extension host, not workspace-local history; row tooltips include available artifact kinds and producer provenance, without assuming a workspace. The Live Diagnostics action tree groups captures under CPU, Memory & GC, Threads & waits, Requests & networking, and Exceptions. Monitoring contains separate Live counters & GC pauses and Live Events views. Switching views does not start or stop either stream, collect or reopen evidence, or change event acknowledgements. An optional What are you investigating? group adds symptom-first paths for high CPU, memory growth or GC pressure, slow requests, locks/waits, exceptions/crashes, and general runtime health. Choosing a symptom only opens a bounded evidence picker: it shows the active target (or that the existing process picker will run), one recommended first measurement, relevant alternatives, collection/monitoring/artifact semantics, impact/privacy/platform prerequisites, and All diagnostic actions. It never collects, reconnects, requests privileges, opens retained evidence, or replaces a result until a concrete existing action is chosen. The selected symptom remains visible on the group while canonical Monitoring, Workspace and Investigation surfaces own all empty, collecting, ready, insufficient-evidence, permission-limited, disconnected and cancelled states. Each stream keeps its own lifecycle, status, retained buffer and controls. Expand an action-tree group to browse; only selecting an action enters its existing capture/consent flow. Counter history remains bounded across Stop/Start. The panel identifies the current counter session and retained session numbers; chart lines break at session boundaries and observed sequence gaps rather than imply continuous collection. Sequence-gap counts belong to the current counter/GC session, while the chart-series cap and GC totals remain panel-wide. The counter identity includes its provider/name, reported kind and unit; the value axis auto-scales and is not necessarily zero-based. Chart bounds and window controls use receipt time, not target time. Click or use Left/Right/Home/End to mark the nearest retained observation without interpolation. Pause following freezes the receipt-time selection, not collection or retention. Follow latest resumes following. Window choices only select retained data, never extend retention; the receipt-time disclosure exposes exact bounds and custom start/end sliders. Expired paused selections can become empty, which is not a zero measurement. Live Events configuration uses explicit provider names, a named EventSource level and a signed decimal keyword mask; it does not guess provider presets. The panel keeps the requested PID, providers, level and exact keyword value visible. Waiting for first event remains until a non-empty event batch arrives, including after a restart; an empty stream does not establish target inactivity. Newest rows appear first. Pausing shows arrivals and retention evictions while acknowledgements continue; expired mounted rows and selected payload details are removed. Quality distinguishes current-stream source/delivery counts from panel-lifetime UI evictions and truncations. Nonzero counts and unknown source loss remain prominent, with every layer available in the quality disclosure. Clear only removes retained rows and selection; it does not reset quality accounting, the subscription or whether the stream has observed an event. Capture Diagnostics remains the searchable expert catalog for all ten capture kinds. Its generic results appear in their canonical Workspace area; allocations keep their dedicated profile and query path. The live panel's Workspace progresses through Area → Evidence to inspect → Analysis for CPU, Memory & GC, Threads & waits, Requests & networking, and Exceptions. A stage with only one meaningful option becomes a heading instead of a disabled selector, so ordinary captures show Result summary rather than a disabled Capture result choice. A compact state label distinguishes Local switch, Retained query, and New collection, while concrete actions such as Capture new CPU samples and Load call tree stay beside the current state. The evidence identity and lifecycle disclosure keeps source, target, quality, replacement and display-only context available. Merely changing Area, Evidence to inspect or Analysis never collects, reattaches, elevates, reopens an origin or replaces evidence. Thread snapshots and off-CPU/contention/thread-pool captures share their area's presentation without sharing evidence ownership: the snapshot handle is independent from the single replaceable generic-capture result. Standalone requests, Kestrel, database, and networking captures share the Requests & networking workspace and the existing single replaceable generic-capture result; its Result summary heading is descriptive, not a retained-handle query. Select the ordinary kind under Evidence to inspect, then use its explicit capture action in the Workspace to use its existing parameter prompts. Replacement and sensitive-data guidance is visible before capture; ordinary captures cannot be cancelled here. A compact active-quality alert precedes the returned data, with full reasons available at the alert. Metrics, full quality scope and stable table guidance follow the rows. In-flight request results lead with the capture-window summary and retained request rows; state filters and search apply only to returned rows, with truncation and capture-quality notes kept visible. Managed-exception and crash-guard results use a separate single replaceable exception result, keep the selected mode and live EventPipe target visible, and do not become history or queryable evidence by navigating. Results are temporary and are not saved; sending a capture clears the current exception result; if collection then fails, it cannot be restored. Exception messages can contain sensitive application data; a process exit alone does not prove an unhandled exception. Started timestamps display in UTC; the original ISO value remains available to assistive technology and in the timestamp tooltip. Monitoring, dump analysis, and saved evidence keep their source-specific result surfaces. Analyze Dump File and Saved Captures remain separate offline entry points. On a process, Capture New Persistent Snapshot collects a separate durable live heap, GC dump, or thread snapshot. It never converts a temporary panel result or a redacted sharing document. After two compatible heap captures, expand Incremental retained-memory growth in the live Workspace and explicitly choose the earlier baseline and later current evidence. The extension sends only CLI JSONL queries: the CLI supplies bounded retained byte/instance deltas, supported growing-type rankings, and objective evidence for the selected pair. Repeated median/MAD/bootstrap statistics are unavailable in this workflow because the extension does not submit repeated pairs. Allocation traffic, root path availability, GC-dump-induced Gen2 observer effects, evidence identity, assumptions, limitations, and unavailable reasons remain separate and visible under disclosure. Selecting a supported growing type requests its objective evidence and returns to the canonical current heap explorer for bounded instances, object details, and an actual GC root path where the source supports them. The lens never captures automatically, persists handles, or reports a leak, regression, health, causality, or no-leak verdict; expired or replaced handles require another explicit pair or capture. Requests + completed Activities is a separate explicit reproduction action in Requests &
networking and the Command Palette. It requires the additive The request table shows only first-accepted requests still pending at window close. The Capture action keeps scope in the Evidence selector. A compact result summary shows retained counts and the requested duration; retention, coverage and duration-interpretation guidance follows the data. Active partial/loss/unavailable warnings remain next to the results. Its All / Long-running filter uses a clearly labelled local ≥ 1,000 ms threshold, not the standalone collector's classification. Expand a request row with the keyboard-operable chevron; the first expansion queries completed Activities already retained by the exact CLI capture, not the process, and starts no new capture. Collapse/reopen of the same row is local. A different row replaces the sole cached response. The request's trace/span identifiers and start time remain accessible in its inline disclosure after Activities load. Structural direct-child/descendant/shared-trace basis is separate from verified/withheld status; finished durations are not a critical path or proof of exclusive delay. Associated Activities use compact operation/time rows aligned with the request's time column. Requests carry an In flight marker: their time is elapsed at window close, while Activity times are finished durations. Flat indentation groups associations, not a call tree. Weak link marks same-trace-only evidence; Unverified remains visible where verification is withheld. Expand an Activity locally for source, timing, identifiers, relationship basis and withheld reason; this performs no additional CLI query or collection. The joint result replaces the shared generic slot. CLI evidence expires after ten minutes, disconnect or another capture; loaded displays then say retained-only and further reads are disabled. Only completed Activity Stop records are supported, so empty results do not mean no open or uninstrumented work. No export, saving, telemetry lookup, privileged attach or MCP connection is added. See the reference. For a guided introduction, run .NET Diagnostics: Open Getting Started from the Command Palette. ScreenshotsIllustrative panels using fixture data, not live captures. Live counters and GC pauses
Heap snapshot and drilldowns
Thread snapshot
Permissions and sensitive dataRun the CLI as the same OS user as your app. Some captures can briefly pause the target or trigger a GC; live heap/thread inspection also needs OS tracing permissions. Higher-impact actions ask for confirmation before running. Captures can contain sensitive application data. Open redacted measurements (JSON/CSV) uses only the displayed result and intentionally excludes application text and identifiers. The output is lossy and cannot reopen an investigation. Raw traces are not redacted: they must be retained when collecting new CPU evidence, require explicit confirmation, and can only be saved locally from that retained capture. Export actions never collect again and no automatic upload occurs. Windows, macOS and Linux desktop/workspace hosts are supported, including Remote SSH, WSL and Dev Containers. Install the CLI in that same host environment; browser-only VS Code is not supported. Learn more |


