title: Failed to find runtime clr.dll to use sos
body: <p>I have simple console application (target framework 4.5.2):</p>
  
  <pre><code>using System;
  
  public class SosTest
  {
      public class Foo
      {
          public Foo()
          {
              Console.WriteLine("Creation of foo");
          }
      }
  
      static void Main(string[] args)
      {
          var n1 = new Foo();
          var n2 = new Foo();
          Console.WriteLine("Allocated objects");
          Console.WriteLine("Press any key to invoke GC");
          Console.ReadKey();
          n2 = n1;
          n1 = null;
          GC.Collect();
          Console.WriteLine("Press any key to exit");
          Console.ReadKey();
      }
  }
  </code></pre>
  
  <p>I want to see state of managed heap. I do following steps:</p>
  
  <ol>
  <li>Open windbg </li>
  <li>Open exe file of my program with windbg's "open executable" command</li>
  <li>Perform command to load sos <code>.load MicrosoftNet\Framework\v4.0.30319\sos.dll</code></li>
  <li>Perform command to see state of heap <code>!eeheap -gc</code></li>
  </ol>
  
  <p>But during last command I get following message:</p>
  
  <blockquote>
    <p>Failed to find runtime DLL (clr.dll), 0x80004005
    Extension commands need clr.dll in order to have something to do.</p>
  </blockquote>
  
  <p>Why does command <code>!eeheap -gc</code> fail?</p>
  
  <p>If it will help it is result of <code>lm</code> command:</p>
  
  <pre><code>0:000&gt; lm
  start    end        module name
  00be0000 00be8000   ConsoleApplication1   (deferred)            
  734c0000 73519000   MSCOREE    (deferred)             
  74c20000 74d00000   KERNEL32   (deferred)             
  753d0000 75571000   KERNELBASE   (deferred)             
  77d80000 77f03000   ntdll      (pdb symbols)
  </code></pre>