Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows SDK - C# - Debugging process exiting with error code -1073741502
    primarykey
    data
    text
    <p><strong>SHORT VERSION</strong></p> <p>How do you figure out which DLL is failing to load (and potentially why) when a process exits with error code -1073741502?</p> <p><strong>LONG VERSION</strong></p> <p>I'm trying to write a pretxnchangegroup hook for Mercurial, and as a part of that hook I need to get the output of running the command:</p> <p><code>hg log</code></p> <p>The code that I'm using to start and run the hg.exe process is as follows:</p> <pre><code>string Command = "log"; Process p = new Process(); ProcessStartInfo psi = p.StartInfo; p.StartInfo.FileName = @"C:\Program Files (x86)\Mercurial\hg.exe"; psi.CreateNoWindow = true; psi.LoadUserProfile = true; psi.RedirectStandardError = true; psi.RedirectStandardOutput = true; psi.UseShellExecute = false; psi.WorkingDirectory = Environment.CurrentDirectory; p.StartInfo.Arguments = Command; // Pass-through environment variables psi.UserName = Properties.Settings.Default.HG_User; psi.Domain = Properties.Settings.Default.HG_Domain; psi.Password = new System.Security.SecureString(); foreach (char c in Properties.Settings.Default.HG_Pass) { psi.Password.AppendChar(c); } p.Start(); p.WaitForExit(); </code></pre> <p>The problem is that the process keeps exiting with error code -1073741502, without outputting anything on Standard Output or Standard Error. After some research online, I discovered that this error code has something to do with the application failing to initialize properly (couldn't find DLL's, maybe?), but I have no idea how to go about figuring out how to fix it.</p> <p>Keep in mind that this hook is being called for when I'm pushing to the repository over the web (so, IIS is calling the Mercurial CGI via Python, which has this program configured as a hook). </p> <p>In a totally different web application, I'm able to run HG commands just fine, and I'm also able to run this by doing <code>runas /user:&lt;same account as in the code&gt; /noprofile cmd.exe</code> and then manually typing in the hg command line.</p> <p>Also, if I set <code>UseShellExecute = true</code>, then it executes just fine, but then I can't get the Standard Output. I'm really tempted to just make a web service call to the web app which <em>is</em> able to execute this command successfully, but that'd be a really ugly solution.</p> <p>Any ideas why this thing isn't executing? </p>
    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.
 

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