title: .NET application hangs before loading its image
body: <p>The issue appears sometimes on several machines in our domain:
  The user starts my .NET 4.0 application, but nothing happens.
  Machines run Windows XP, .NET version is 4.0.30319.1008</p>
  
  <p>As I can see in <a href="http://en.wikipedia.org/wiki/Windows_Task_Manager" rel="nofollow">Task Manager</a> the process is started, but it uses only 40&nbsp;KB of memory (sometimes more, for example, 404&nbsp;KB, but ordinary running process needs much more). When I try to kill this process, the system says it's done successfully, but the process stays in memory and .exe file is locked. Only restarting the machine helps to kill the process and unlock the file.</p>
  
  <p>I tried to use <a href="http://en.wikipedia.org/wiki/Process_Monitor" rel="nofollow">ProcMon</a> for analizing, but I could see very few events and the process stops before loading its image (Load Image operation does not happen). So the cause is not inside my application.</p>
  
  <p>As a workaround I tried some things:</p>
  
  <ol>
  <li><p>Rebuild the application and replace the .exe in its location - it helps! But the difference between two EXE files is only the changed MVID GUID and some other compile information included in the .exe</p></li>
  <li><p>So my thought was that crashed native image of the assembly is cached somewhere, so replacing the .exe initiates the system to rebuild it. I am not strong in this, but I tried "ngen update" instruction - sometimes it helps, sometimes not.</p></li>
  </ol>
  
  <p>After some time the problem repeats on some machines.</p>
  
  <p>How can I find what is causing the problem?</p>