I create this message in program:
Failure in AutoExtract for switch set to Monthly
Then program returns this error:
System.ComponentModel.Win32Exception (0x80004005): The specified executable is not a valid application for this OS platform.
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at AutoExtract.AutoExtract.ProcessExtract(String msg)
at AutoExtract.AutoExtract.MonthlyExtract(String path)
at AutoExtract.AutoExtract.Main(String[] args)
Here is code for that method.
public static void ProcessExtract(string msg) { int retCode = 0;
//Run program Process extProcess = new Process(); extProcess.StartInfo.FileName = executable; Output_Files.PrintLog(extProcess.StartInfo.FileName); extProcess.StartInfo.Arguments = runDate; extProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; extProcess.StartInfo.CreateNoWindow = true; extProcess.StartInfo.WorkingDirectory = path + ""; extProcess.Start(); extProcess.WaitForExit(); retCode = extProcess.ExitCode; extProcess.Close(); extProcess.Dispose();
if (retCode != 0) { string message = "The " + name + " " + msg + " Extract Failed with a return code: " + retCode.ToString(); Exception ex = new Exception(message); throw ex; } }