Mar 09 2010

How To Use Debugging Tools For Windows To Debug A .Net Application

Download the driver developer kit.  And mount or burn the ISO.

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=36a2630f-5d56-43b5-b996-7633f2ec14ff

Or maybe this direct link to the iso will work.

http://download.microsoft.com/download/4/A/2/4A25C7D5-EFBE-4182-B6A9-AE6850409A78/GRMWDK_EN_7600_1.ISO

Browse to the Debuggers folder and install the debugging tools.  If your machine is x64 install x64 edition as it can debug x86 software.

This will install the Debugging Tools for Windows in the Program Files.
Open a command prompt and change to the Debugging Tools for Windows folder.
Run ADPLUS -Crash -pmn <EXE_NAME> -o <DUMP_PATH> .

Start the errant app.  ADPlus should attach automatically to the process.  If that doesn’t work try some of the other command switches beside -pmn.

Use the app until the the crash occurs.  A dump file will be created in your output folder (defined in the -o switch.)

Start WinDbg.  Open the Crash file.  For .NET you are most likely to get good data from the 2nd time crash dump rather than 1st time.

In WinDbg…load the symbol files from the file menu Symbol File Path by entering
srv*c:\symbols*http://msdl.microsoft.com/download/symbols  (see http://support.microsoft.com/kb/892277)

In the windbg console, type .loadby sos mscorwks
In the windbg console, type !PrintException
Analyze the output.

See http://geekswithblogs.net/.netonmymind/archive/2006/03/14/72262.aspx for a helpful cheat sheet.

This is NOT COMPLETE.  This is for one very narrow scenario.  But it might help you get started.