I am running an exe file from C# code, due to some reasons error occurs in that exe file. It keeps waiting and ultimately gives a popup error "abc.exe has stopped working" and so on, but it does not exit.
//The below code is calling it successfully
public bool callExe(string exePath)
{
Log("EXE excution Started : " + exePath, INFO_TAG);
try
{
Process exeProcess = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = exePath;
exeProcess.StartInfo = startInfo;
startInfo.Arguments = this.prjId.ToString();
exeProcess.Start();
exeProcess.WaitForExit();
int exitCode = exeProcess.ExitCode;
return true;
}
catch (Exception e)
{
errorCode = EXE_ERROR;
return false;
}
}
Though I can capture exit code, but I can do so only if it exits.