Skip to content
.NET Crash Dump Collection

.NET Crash Dump Collection

MIT
Repository Docs
markdown Development
dotnetcsharpdiagnosticscrash-dumpskubernetes

Summary

The .NET team's official skill for capturing crash dumps from CoreCLR and NativeAOT apps on Linux, macOS, Windows and inside containers — collection only, no analysis.

Features

  • CoreCLR vs NativeAOT detection from a binary or a live process
  • Automatic crash-dump configuration and on-demand collection
  • Docker and Kubernetes dump collection, including required capabilities
  • Hard stop signals: no analysis, no code changes, no .NET Framework

Install This Skill

Add this skill to your favorite AI agent in a few steps.

Any AI agent

This skill is plain instructions — it works with any assistant that accepts custom instructions or system prompts.

  1. Copy the skill content with the button below.
  2. Paste it into your agent's instruction file or system prompt (for example AGENTS.md, .cursorrules, or a custom instructions field).
  3. Ask the agent to apply the skill whenever the task matches.

Skill Content

Markdown Content

Copy this content and use it with your preferred AI agent

---
name: dump-collect
description: "Configure and collect crash dumps for modern .NET applications. USE FOR: enabling automatic crash dumps for CoreCLR or NativeAOT, capturing dumps from running .NET processes, setting up dump collection in Docker or Kubernetes, using dotnet-dump collect or createdump. DO NOT USE FOR: analyzing or debugging dumps, post-mortem investigation with lldb/windbg/dotnet-dump analyze, profiling or tracing, or for .NET Framework processes."
license: MIT
---

# .NET Crash Dump Collection

This skill configures and collects crash dumps for modern .NET applications (CoreCLR and NativeAOT) on Linux, macOS, and Windows — including containers.

## Stop Signals

🚨 **Read before starting any workflow.**

- **Stop after dumps are enabled or collected.** Do not open, analyze, or triage dump files.
- **If the user already has a dump file**, this skill does not cover analysis. Let them know analysis is out of scope.
- **Do not install analysis tools** (dotnet-dump analyze, windbg). Only install collection tools (dotnet-dump collect). Using `lldb` for on-demand dump capture on macOS is allowed — it ships with Xcode command-line tools and is not being used for analysis.
- **Do not trace root cause** of crashes. Report the dump file location and move on.
- **Do not modify application code.** Configuration is environment-only (env vars, OS settings, container specs).

## Step 1 — Identify the Scenario

Ask or determine:

1. **Goal**: Enable automatic crash dumps, or capture a dump from a running process right now?
2. **Platform**: Linux, macOS, or Windows? Running in a container (Docker/Kubernetes)?
3. **Runtime**: CoreCLR or NativeAOT?

### Detecting CoreCLR vs NativeAOT

**From a binary file (Linux/macOS):**
```bash
# CoreCLR — has IL metadata / managed entry point
strings <binary> | grep -q "CorExeMain" && echo "CoreCLR"

# NativeAOT — has Redhawk runtime symbols
strings <binary> | grep -q "Rhp" && echo "NativeAOT"

# On macOS/Linux, also try:
nm <binary> 2>/dev/null | grep -qi "Rhp" && echo "NativeAOT"
```

**From a binary file (Windows):**
```powershell
# CoreCLR — has a CLI header (IL entry point)
dumpbin /clrheader <binary.exe> | Select-String "CLI Header" -Quiet

# NativeAOT — no CLI header, has Redhawk symbols
dumpbin /symbols <binary.exe> | Select-String "Rhp" -Quiet
```

**From a running process (Linux):**
```bash
# Resolve the binary, then use the same file checks
BINARY=$(readlink /proc/<pid>/exe)
strings "$BINARY" | grep -q "CorExeMain" && echo "CoreCLR" || echo "NativeAOT"
```

**From a running process (macOS):**
```bash
# Resolve the binary path from the running process
BINARY=$(ps -o comm= -p <pid>)
strings "$BINARY" | grep -q "CorExeMain" && echo "CoreCLR" || echo "NativeAOT"
```

**From a running process (Windows PowerShell):**
```powershell
# CoreCLR — loads coreclr.dll
(Get-Process -Id <pid>).Modules.ModuleName -contains "coreclr.dll"

# .NET Framework — loads clr.dll (this skill does not apply)
(Get-Process -Id <pid>).Modules.ModuleName -contains "clr.dll"
```

> **If the app is .NET Framework (`clr.dll`), stop.** This skill covers modern .NET (CoreCLR and NativeAOT) only.
>
> **If neither CoreCLR nor NativeAOT is detected, stop.** This skill only applies to .NET applications — do not proceed.

## Step 2 — Load the Appropriate Reference

Based on the scenario identified in Step 1, read the relevant reference file:

| Scenario | Reference |
|----------|-----------|
| CoreCLR app (any platform) | `references/coreclr-dumps.md` |
| NativeAOT app (any platform) | `references/nativeaot-dumps.md` |
| Any app in Docker or Kubernetes | `references/container-dumps.md` (then also load the runtime-specific reference) |

## Step 3 — Execute

Follow the instructions in the loaded reference to configure or collect dumps. Always:

1. **Confirm the dump output directory exists** and has write permissions before enabling collection.
2. **Report the dump file path** back to the user after collection succeeds.
3. **Verify configuration took effect** — for env vars, echo them; for OS settings, read them back.
4. **Remind the user to disable automatic dumps if they were enabled temporarily** — remove or unset `DOTNET_DbgEnableMiniDump` and related env vars to avoid accumulating dump files.

Usage Instructions

Learn how to use this skill with different AI agents.

Generic Instructions

Install the dotnet-diag plugin from the .NET team's skills repository:

npx skills add dotnet/skills --skill dump-collect

The repository is also published as a Claude Code plugin marketplace — see the repository README for claude plugin marketplace add dotnet/skills.

Example Usage

"Our ASP.NET Core pod is crash-looping in Kubernetes. Configure it so the next crash writes a full dump to a persistent volume."

Description

Getting a usable crash dump out of a .NET process is a configuration problem, not a debugging one, and the configuration differs by runtime, operating system and whether the process is in a container. Guessing wrong usually means the crash happens again with nothing to show for it.

This official skill from the .NET team walks the decision explicitly. First it establishes the scenario — enable automatic dumps on crash, or capture from a live process — then the platform and the runtime, with concrete commands for telling CoreCLR from NativeAOT from a binary (CorExeMain versus Redhawk Rhp symbols) or from a running process on Linux, macOS and Windows. From there it routes to the right reference: DOTNET_DbgEnableMiniDump environment configuration, dotnet-dump collect, createdump, and the Docker and Kubernetes specifics such as volume mounts and SYS_PTRACE.

What makes it unusually well-behaved as an agent skill is the stop signals section. The skill refuses to open, triage or root-cause a dump, refuses to install analysis tooling such as dotnet-dump analyze or WinDbg, refuses to modify application code, and bails out entirely if the process turns out to be .NET Framework. It reports where the dump landed and stops — which is exactly what you want from a step that runs inside a larger incident workflow.

Related Skills

Skill: Genkit for JavaScript

by Genkit (Google)

New

The official Genkit skill for Node.js and TypeScript — flows, Dotprompt files, tools and the beta agent API with sessions, interrupts and branching.

Development

Skill: Superpowers

by Jesse Vincent

New

An agentic software-development methodology: composable skills that push a coding agent through spec, plan, TDD and review instead of straight into code.

Development

Skill: SkillHone

by Tencent

New

Tencent's skill-evolution harness: it rewrites a whole skill folder — SKILL.md, scripts and references together — and lands every decision as a real Git issue, PR and wiki entry you can review.

Development

Skill: OpenSearch Launchpad

by OpenSearch Project

New

Take an OpenSearch search application from requirements to a running cluster — BM25, dense and sparse vectors, hybrid retrieval, agentic search and RAG, with relevance evaluation built in.

Development
2 views
Browse all skills →