Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>WinDbg is a user and kernel mode debugger, but on its own it doesn't really understand managed code and as such the <code>!analyze</code> command is of limited use. If you want to debug managed applications using WinDbg, you need some way to make WinDbg understand the internal structures of managed code. There are a number of extension DLLs that enables this. The .NET framework ships with sos.dll and there are downloads such as <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5c068e9f-ebfe-48a5-8b2f-0ad6ab454ad4" rel="nofollow">psscor2.dll</a> and <a href="http://www.stevestechspot.com/" rel="nofollow">sosex.dll</a>.</p> <p>SOS and PSSCOR2 provide more or less the same features while SOSEX adds new features for managed debugging. Help files for each of these are available from withing WinDbg. E.g. to get the help for SOS you can use the <code>!sos.help</code> command. </p> <p>You have to load either SOS or PSSCOR2 and possibly SOSEX to debug a managed application with WinDbg. E.g. if you want to load SOS you use the load command like this</p> <p><code>.loadby sos clr</code></p> <p>This will load SOS from the location of the .NET runtime. Please note that the runtime is called <code>mscorwks</code> in .NET 2 and <code>coreclr</code> in Silverlight, so if you're using either of these, you need to change the <code>.loadby</code> command accordingly. </p> <p>WinDbg needs symbols to display additional information. This is particular important for unmanaged code. You can use the <code>.symfix</code> command to let WinDbg retrieve symbols as needed from Microsoft's symbol server.</p> <p>As your application is hanging, there's a good chance that you'll have one or more blocked threads. You can view managed threads using the <code>!threads</code> (or just <code>!t</code>) command. In .NET simple locks are implemented internally using a structure called SyncBlocks. You can view these using the <code>!syncblk</code> command. If you have loaded SOSEX the <code>!dlk</code> command can automatically detect deadlocks. </p> <p>If you want more information, there are a couple of books and some blogs to read.</p> <p>Books:</p> <ul> <li><a href="http://advanceddotnetdebugging.com/" rel="nofollow">Advanced .NET Debugging</a> by Mario Hewardt. There's also a book on <a href="http://advancedwindowsdebugging.com/" rel="nofollow">native debugging</a> from the same author. </li> <li><a href="http://www.microsoft.com/learning/en/us/book.aspx?ID=8650&amp;locale=en-us" rel="nofollow">Debugging Microsoft .NET 2.0 Applications</a> by John Robbins</li> <li><a href="http://rads.stackoverflow.com/amzn/click/0735627045" rel="nofollow">CLR via C#</a> by Jeffrey Richter is an excellent introduction to the internals of the CLR.</li> </ul> <p>Blogs:</p> <ul> <li><a href="http://blogs.msdn.com/b/tess/" rel="nofollow">Tess' blog</a> is great. It has numerous tutorials and labs you can use to practice. </li> <li><a href="http://blogs.msdn.com/b/tom/" rel="nofollow">Tom's blog</a> is also very useful.</li> </ul> <p>Videos:</p> <ul> <li>I did a presentation on managed debugging at the Microsoft development center in Denmark. Videos are available on Channel p. <a href="http://channel9.msdn.com/posts/MDCC-TechTalk-Advanced-NET-Debugging-part-1" rel="nofollow">Part 1</a> and <a href="http://channel9.msdn.com/posts/MDCC-TechTalk-Advanced-NET-Debugging-part-2" rel="nofollow">part 2</a>.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload