title: Process spawned through Process.Start in .NET hangs the thread
body: <p>Our application has a background thread which spawns a process through <code>System.Diagnostics.Process</code>:</p>
  
  <pre><code>Process.Start(
      new ProcessStartInfo
      {
          FileName = url,
          UseShellExecute = true
      }
  );
  </code></pre>
  
  <p>This used to have no issues at all.  But now, the background thread is silently dying; it never returns from the call to <code>Process.Start</code>.  The catch block for this code, which handles <code>System.Exception</code>, is not getting reached either.  Even if I enable handling exceptions when thrown in the Visual Studio debugger, I see no exceptions.  Strangely, the process is getting spawned just fine; the default browser for the user is launched with the expected URL.</p>
  
  <p>Our process's entry point is marked with <code>[STAThread]</code> as recommended.</p>
  
  <p>What could be causing our thread to silently terminate?  Are there any techniques I can use to debug what's happening during thread termination?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>It looks like the thread is alive after all; it's just not returning from the call.  Here's its stack trace:</p>
  
  <ul>
  <li>[In a sleep wait or join]</li>
  <li>System.dll!System.Diagnostics.ShellExecuteHelper.ShellExecuteOnSTAThread() + 0x63 bytes   </li>
  <li>System.dll!System.Diagnostics.Process.StartWithShellExecuteEx(System.Diagnostics.ProcessStartInfo startInfo) + 0x19d bytes    </li>
  <li>System.dll!System.Diagnostics.Process.Start() + 0x39 bytes    </li>
  <li>System.dll!System.Diagnostics.Process.Start(System.Diagnostics.ProcessStartInfo startInfo) + 0x32 bytes   </li>
  <li>My method</li>
  </ul>
  
  <p><strong>Update 2:</strong></p>
  
  <p>Launching cmd.exe without using the shell to execute works as a workaround.  Thanks a bunch!  However, I'd still like to know <em>why</em> the call isn't returning.</p>
  
  <p><strong>Update 3:</strong></p>
  
  <p>Shell hooks do sound like a logical explanation for what could be causing the call to not return.  I couldn't find the rogue module, but after the last attempt to run things through shell execution, the call <em>did</em> return.</p>
  
  <p>In any case, it's possible that users may have shell extensions loaded that could be messing with the process launching and causing my code to not return.  We can't do anything about <em>that</em>, so the right answer is to use the workaround of launching a cmd.exe process.</p>