# Sample: analyzing a .NET crash dump with an AI agent

CrashDemo processes three orders and crashes on the third one with a NullReferenceException whose message
says nothing useful. The data that explains the crash only exists in memory.

    ./collect.sh              # runs the app, the runtime writes artifacts/crash.dmp when it crashes
    ./run-in-docker.sh        # same, inside a Linux container (use this on macOS)

Then let the agent investigate. Every SOS command works non-interactively, which is what makes it usable:

    dotnet-dump analyze artifacts/crash.dmp -c "clrthreads" -c "printexception" -c "exit"
    dotnet-dump analyze artifacts/crash.dmp -c "dso" -c "exit"
    dotnet-dump analyze artifacts/crash.dmp -c "dumpobj <address>" -c "exit"

The dump is collected with DOTNET_DbgMiniDumpType=4 (Full) on purpose: on a Heap or Mini dump, dumpobj cannot
read field values.

.claude/skills/analyzing-dotnet-dumps/SKILL.md is the skill the agent uses. Claude Code and GitHub Copilot read
it from that path as is; for Codex, move the analyzing-dotnet-dumps folder to .agents/skills/.

Prerequisites: .NET 10 SDK, and the diagnostic tools:

    dotnet tool install --global dotnet-dump
    dotnet tool install --global dotnet-gcdump
    dotnet tool install --global dotnet-counters
