dump-collect
Configures and collects crash dumps for modern .NET applications: enabling automatic crash dumps for CoreCLR or NativeAOT, capturing dumps from running processes, setting up collection in Docker or Kubernetes, and using dotnet-dump collect or createdump. Use when a crash dump must be enabled or captured. Not for analyzing or debugging dumps (lldb, windbg, dotnet-dump analyze), profiling or tracing (use dotnet-trace-collect), or .NET Framework processes.
- License 许可
- MIT
- 所属仓库
- Cratis/Prologue
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- dump-collect
- license
- MIT
- description
- Configures and collects crash dumps for modern .NET applications: enabling automatic crash dumps for CoreCLR or NativeAOT, capturing dumps from running processes, setting up collection in Docker or Kubernetes, and using dotnet-dump collect or createdump. Use when a crash dump must be enabled or captured. Not for analyzing or debugging dumps (lldb, windbg, dotnet-dump analyze), profiling or tracing (use dotnet-trace-collect), or .NET Framework processes.
02 资源文件 5
- 许可证LICENSE1.1 KB
- 其他NOTICE2.9 KB
- 参考文档references/container-dumps.md11.7 KB
- 参考文档references/coreclr-dumps.md3.3 KB
- 参考文档references/nativeaot-dumps.md8.9 KB
03 SKILL.md 正文
<!-- cratis-ai-managed: skills/dump-collect/SKILL.md -->
<!-- Modified by Cratis from dotnet's original (MIT): frontmatter, applicability, navigation and the changes listed in NOTICE. Upstream: https://github.com/dotnet/skills (plugins/dotnet-diag/skills/dump-collect/SKILL.md; see NOTICE) -->
.NET Crash Dump Collection
Cratis rules in .cratis/ai/rules/ (including csharp.md, specs.csharp.md, and orleans.md) and the cratis-* skills win where they differ. Dumps contain all process memory, including secrets and personal data: keep them local and task-scoped, never attach to issues or PRs; changing the host core_pattern needs the user's approval.
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
lldbfor 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:
- Goal: Enable automatic crash dumps, or capture a dump from a running process right now?
- Platform: Linux, macOS, or Windows? Running in a container (Docker/Kubernetes)?
- Runtime: CoreCLR or NativeAOT?
Detecting CoreCLR vs NativeAOT
Decide from positive evidence. A native executable that lacks one marker is not thereby NativeAOT: modern CoreCLR apphost executables are native launchers too, so CorExeMain (an import of managed .NET Framework-style executables) is not a reliable CoreCLR test. Treat the result as unknown, and ask the user, when the evidence below conflicts or is missing.
From files next to the executable (any platform):
- A CoreCLR apphost (framework-dependent or self-contained) sits beside
<app>.dlland<app>.runtimeconfig.json, usually also<app>.deps.json. A self-contained app also shipslibcoreclr.so,libcoreclr.dyliborcoreclr.dll. Treat these as CoreCLR. - A CoreCLR single-file app has no sibling
.dll/.runtimeconfig.jsonbecause they are bundled into the executable. Do not read that as NativeAOT; use the loaded-module check below, and ask the user how the app was published if it is still unclear. - A NativeAOT app is a single native executable (plus optional native libraries) with no
<app>.dll, no<app>.runtimeconfig.jsonand no runtime libraries beside it. It embeds the Redhawk runtime, whose symbols and strings start withRhp.
# Linux/macOS: positive NativeAOT hint (Redhawk runtime strings/symbols)
strings <binary> | grep -q "Rhp" && echo "NativeAOT (Rhp present)"
nm <binary> 2>/dev/null | grep -qi "Rhp" && echo "NativeAOT (Rhp symbols)"
# Windows: positive NativeAOT hint (Redhawk symbols)
dumpbin /symbols <binary.exe> | Select-String "Rhp" -Quiet
From a running process (Linux):
# CoreCLR loads libcoreclr; a NativeAOT process does not
grep -q libcoreclr /proc/<pid>/maps && echo "CoreCLR"
From a running process (macOS):
# CoreCLR loads libcoreclr.dylib; a NativeAOT process does not
vmmap <pid> 2>/dev/null | grep -q libcoreclr && echo "CoreCLR"
From a running process (Windows 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"
A running process that loaded no CoreCLR runtime module and whose binary shows the NativeAOT file layout and Rhp evidence is NativeAOT. A single-file self-contained CoreCLR app can link the runtime into the host, so a missing libcoreclr/coreclr.dll module alone does not prove NativeAOT.
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:
- Confirm the dump output directory exists and has write permissions before enabling collection.
- Report the dump file path back to the user after collection succeeds.
- Verify configuration took effect — for env vars, echo them; for OS settings, read them back.
- Remind the user to disable automatic dumps if they were enabled temporarily — remove or unset
DOTNET_DbgEnableMiniDumpand related env vars to avoid accumulating dump files.
04 同仓库更多 Skills
vectorization
Designs, implements, optimizes, and reviews SIMD code in .NET: vectorizing scalar loops with TensorPrimitives, Vector64, Vector128, Vector256, Vector512, or hardware intrinsics, and reviewing existing SIMD code, including the generic Vector type, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. Use when a .NET loop or SIMD routine is being written or reviewed. Not for performance work unrelated to SIMD.
target-authoring
Canonical patterns for writing custom MSBuild targets: DependsOnTargets versus BeforeTargets and AfterTargets, the Build-to-CoreBuild three-level pattern, and the XxxDependsOn chain-extension pattern. Use when diagnosing or fixing custom-target anti-patterns: Directory.Build.targets redefining SDK targets, targets that replace CompileDependsOn instead of extending it, Outputs versus Returns misuse that returns stale results, missing Inputs/Outputs causing needless rebuilds, or missing FileWrites registration. Not for incremental build tuning or general anti-pattern review (use the msbuild skill), or non-MSBuild build systems.
run-tests
Chooses and runs the repository-compatible .NET test command: classic, VSTest, bridged MTP, or native MTP syntax for MSTest, xUnit, NUnit, and TUnit. Use before running .NET tests or answering with a test command or flags: run the tests, one test, class, category, trait or target framework, combined filters, --filter-query, --no-build, --diag, TRX, coverage collection, crash or hang dumps, filter errors, or unrecognized options. Not for platform identification alone (use platform-detection), writing or debugging test code, interpreting a coverage report (use coverage-analysis), CI investigation, migration, or a persistent hot-reload loop.
profiling
Uses the free official .NET diagnostics CLI tools for profiling and runtime investigation in a repository: CPU, GC pressure, allocation growth, exception storms, lock contention, and slow code. Use when a .NET application needs performance or runtime profiling. Not for replacing realistic performance or load tests with ad-hoc tracing, production heap collection without a pause-risk plan, crash dumps (use dump-collect), or benchmark design (use microbenchmarking).
platform-detection
Identifies a .NET project's test platform, framework, command mode, and SDK-style versus classic project system, resolving global.json, project, packages.config, Directory.Build.props, and Directory.Packages.props precedence for MSTest, xUnit, NUnit, and TUnit. Use when asking "which test platform or framework?", "VSTest or MTP?", or "what runner does this project use?", including bridge settings, UseVSTest opt-outs, and conflicting VSTest/MTP configuration. Not for running or filtering tests, commands, flags, TRX, dumps, or test-command errors (use run-tests), or for hot-reload or migration requests.
orleans
Designs Microsoft Orleans systems from each primitive's purpose and failure model: grains, digital twins, state versus databases, transactions, messaging, streams, timers, reminders, Durable Jobs, stateless workers, grain services, startup, and hosting. Use when a task needs an Orleans design decision: inspect version and topology, choose the primitive, implement, and validate. Not for other actor stacks, batch processing, relational-only CRUD, or advice without an Orleans decision.