title: System.Diagnostics.Process.Start() cannot start process when called from Windows service
body: <p>I am trying to start an external process from a .NET Windows service. In the past I have used the <code>Process.Start()</code> overload that takes the executable path and a command line string. This works. But now I would like to start the process and have it run in the context of a particular user. So I call this version of <code>Start()</code></p>
  
  <pre><code>public static Process Start(
      string fileName,
      string userName,
      SecureString password,
      string domain)
  </code></pre>
  
  <p>However, when I call the method, the application I am trying to run generates an unhandled exception:</p>
  
  <p><code>The application failed to initialize properly (0xc0000142). Click on OK to terminate the application.</code></p>
  
  <p>I have tried to start different applications and they all generate the same exception. I have run the code outside of the Windows service and the application starts correctly.</p>
  
  <p>So is there a way to get this to work in a Windows service?</p>