dump-collect

Configure and collect crash dumps for CoreCLR and NativeAOT .NET applications.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill dump-collect-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dump-collect
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-diag/skills/dump-collect
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill dump-collect-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? When a .NET application crashes in production, developers often lack the memory state needed to diagnose the failure. This Skill guides you through enabling automatic crash dump collection or capturing dumps on demand from running .NET processes, across Linux, macOS, Windows, Docker, and Kubernetes. ## Core Features & Use Cases - Automatic crash dump configuration: Set up DOTNET_DbgEnableMiniDump environment variables for CoreCLR apps, or OS-level core dumps (ulimit, core_pattern, WER) for NativeAOT apps. - On-demand capture: Collect dumps from running processes using dotnet-dump collect, gcore, lldb, or procdump depending on platform and runtime. - Container support: Configure Docker and Kubernetes workloads with SYS_PTRACE capability, volume mounts, and pod specs so dumps persist outside the container. - Use Case: Your NativeAOT service keeps crashing in a Kubernetes pod. Use this Skill to add the right security context, environment variables, and a persistent volume so a full dump is written to /dumps on the next crash. ## Quick Start Ask the assistant to enable automatic crash dump collection for your .NET application, specifying the platform, runtime (CoreCLR or NativeAOT), and whether it runs in a container.

Frequently Asked Questions about dump-collect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable automatic crash dumps for a .NET application?

Set the DOTNET_DbgEnableMiniDump=1 environment variable along with DOTNET_DbgMiniDumpType and DOTNET_DbgMiniDumpName before launching the app. CoreCLR then writes a dump automatically when the process crashes.

How do I capture a dump from a running .NET process?

Use dotnet-dump collect -p <pid> for CoreCLR processes on any platform. For NativeAOT, use gcore on Linux, lldb with process save-core on macOS, or procdump on Windows.

Does crash dump collection work in Docker and Kubernetes?

Yes, but the container needs the SYS_PTRACE capability and a writable volume mount for the dump directory. The Skill provides Docker run flags, docker-compose snippets, and Kubernetes pod specs with the required securityContext and env vars.

What is the difference between CoreCLR and NativeAOT dump collection?

CoreCLR supports mini, heap, triage, and full dumps via DOTNET_DbgMiniDumpType, while NativeAOT only supports full dumps. NativeAOT is simplest with OS-level core dumps via ulimit and core_pattern, though createdump also works.

Why is no dump file created after my .NET app crashes?

The most common cause is that the dump output directory does not exist or is not writable, since CoreCLR will not create it. Also verify the environment variables are set and, in containers, that SYS_PTRACE is granted.

Can this Skill analyze or debug an existing dump file?

No, dump analysis is explicitly out of scope. The Skill only configures and collects dumps; post-mortem investigation with dotnet-dump analyze, lldb, or windbg must be done separately.