Console app showing message box on error
- by holz
I am trying to integrate with a vendors app by calling it with command args from c#. It is meant to automate a process that we need to do with out needing anyone to interact with the application. If there are no errors when running the process it works fine.
However if there are any errors the vendors application will show a message box with the error code and error message and wait for someone to click the ok button. When the ok button is clicked it will exit the application returning the error code as the exit code.
As my application is going to be a windows service on a server, needing someone to click an okay button will be an issue. Just wondering what the best solution would be to get around this.
My code calling the vendor app is...
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "someapp.exe"
startInfo.Arguments = "somefile.txt";
Process jobProcess = Process.Start(startInfo);
jobProcess.WaitForExit();
int exitCode = jobProcess.ExitCode;