使用windbg来分析windows平台上的.net程序crash产生的dump文件是一件很困难的事情,因为分析出来的结果都分装在.net里面,我们往往得不到有用的信息,进而就拿这种crash毫无办法。
近来发现vs2010可以作为一个很好的工具来分析这种dump,因此记录下来,备忘。
I find Visual Studio is better tool to analyze C# crash dump than WinDbg, in which you can locate the crash in the layer of C# source code.
Below,I give steps to analyze C# crash dump in Visual Studio 2010.
- Open the crash dump by Visual Studio, then you can see the dump file summary tab after the loading is done.
- Setup symbols path: there are two ways to do this.
- Click "Set symbol paths" link in the dump file summary tab
- Select menu "Tools" -> "Options..." , then enter "Symbols" tab under "Debugging" branch
- Setup sources path:
- In "Solution Explorer", select "Property" in the context menu of the solution
- Add source paths in "Directory containning source code" list control in "Debugging Source Files" tab
- Start debugging by click "Debug with Mixed" or "Debug with Native Only" link in the dump file summary tab