I am running the 1st option that you indicate and provide the java application (java.exe) and the class that I am executing as one of the input parameters. Regardless of the above, the Process dies by killing all associated running processes including the IDE. The entire process (java class parms) does run just fine if I do it outside my code. So again the question is what in the code am I doing incorrectly or is it possible that you or others have run into this problem and figured out what is really going on. And to be very explicit - here is the actual code that I'm using:
DirectoryInfo di = new DirectoryInfo(path);
FileInfo\[\] files = di.GetFiles("\*.xml");
foreach (FileInfo file in files)
{
Text = "Converting: " + file.Name;
String\[\] parms = new String\[1\];
parms\[0\] = file.FullName;
ProcessStartInfo psi = new ProcessStartInfo();
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
psi.FileName = @"\\\\NASA\\GSFC\\CDF\\CDFML2CDF.exe";
psi.Arguments = file.FullName;
psi.WindowStyle = ProcessWindowStyle.Hidden;
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process exeProcess = Process.Start(psi))
{
exeProcess.WaitForExit();
Text = " Processing successful for file = " + file.Name;
Text = " ---- Process output Begin---";
Text = exeProcess.StandardOutput.ReadToEnd();
Text = " ---- Process output End---";
}
}
catch
{
Text = " Processing failed for file = " + file.Name;
}
}
when it executes
Process exeProcess = Process.Start(psi)
The IDE and all threads die. There is nothing logged in the System or application event logs. There is nothing output to the system - IT JUST CRASHES the IDE and Threads. Do you have any helpful ideas or suggestions?