2013-06-24 63 views
2

我用Microsoft.Diagnostics.Runtime,並嘗試分析崩潰轉儲,但我沒有在我的機器上匹配mscordacwks.dllMicrosoft.Diagnostics.Runtime:如何閱讀崩潰轉儲?

請給我一個建議,做什麼或怎樣才能得到它從微軟的符號服務器?

+0

也許這可以幫助你:[如何調試:w3wp.exe進程被終止,由於堆棧溢出(適用於一臺機器,但不是另一臺)](http://stackoverflow.com/questions/5053708/how-到調試W3WP-EXE-過程被終止 - 由於到一個堆棧溢出,作品上/ 13300623#13300623) –

+0

不幸的是,沒有。我不想用WinDb,並嘗試使用MSFT庫Microsoft.Diagnostics.Runtime – burusera

+0

你找到任何答案嗎? –

回答

0

缺少mscordacwks.dll是我不時遇到的一個問題,我不時遇到使用WinDbg查看故障轉儲文件(我注意到您正在嘗試使用ClrMD來實現相同的最終目標)。通常情況下,微軟符號服務器是非常全面的,但在mscordacwks.dll的情況下,公共符號服務器上不存在的所有版本(如描述here)。獲取匹配的mscordacwks.dll版本的最好方法是將其從創建故障轉儲的機器(以及相應的.net框架文件夾)中提取,如果公共符號服務器出現故障。

老實說,我更多的WinDbg的用戶,所以我更習慣於用mscordacwks處理存在,但對谷歌四處尋找我確實發現了幾個有趣的文章。第一個提到的,你可以這樣做:

// DataTarget.ClrVersions lists the versions of CLR loaded in the process (this may be 
// v2 and v4 in the Side-By-Side case. 
ClrInfo version = target.ClrVersions[0]; 

// CLRVersionInfo contains information on the correct Dac dll to load. This includes 
// the long named dac, the version of clr, etc. This is enough information to request 
// the dac from the symbol server (though we do not provide an API to do this). Also, 
// if the version you are debugging is actually installed on your machine, DacLocation 
// will contain the full path to the dac. 
string dacLocation = version.TryGetDacLocation(); 

如果不工作是誰的人發佈的代碼爲DacLocator類,它是更爲複雜。希望這兩個途徑之一應該能夠在您需要的dll版本中加載。

0

ClrVersion類現在有一個TryDownloadDac方法。您需要在與正在調試的應用程序相同的架構中運行流程(64位/ 32位),以便成功將DAC庫加載到流程中。