Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

XSD.exe process StandardError and StandardOutput are both empty, but error code is non zero

$
0
0
So I am trying to run xsd.exe as a process within my code but there seems to be some issue.

I have it set up like:

System.Diagnostics.Process pProcess = new System.Diagnostics.Process();
            System.Diagnostics.ProcessStartInfo p = new System.Diagnostics.ProcessStartInfo
                (baseDirectory + @"SchemaReading\xsd.exe", args);
            pProcess.StartInfo = p;
            pProcess.StartInfo.UseShellExecute = false;
            pProcess.StartInfo.RedirectStandardError = true;
            pProcess.StartInfo.RedirectStandardOutput = true;
            pProcess.StartInfo.CreateNoWindow = true;
            pProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;


            //Start the process
            pProcess.Start();
            string stdError = pProcess.StandardError.ReadToEnd();
            string stdOutput = pProcess.StandardOutput.ReadToEnd();
            pProcess.WaitForExit();

where Args contains two file names, and output directory, and /c to make classes.

When the WaitForExit() line has passed, both stdError and stdOutput are empty strings, and my exit code is -1073741701
I am baffled as to what to do at this point. I cannot figure out what this errorCode is, and have nothing to go on.

My arguments SHOULD be fine, as I have tested this exact input outside of code and it worked fine

Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>