I´m debuging an execution of a process:
public static bool ExecuteApplication(string executablePath, string arguments, bool wait, int waitingTime)
{
bool success = false;
if (CommonFiles.Exists(executablePath))
{
Process application = new Process();
application.StartInfo.FileName = Path.Combine(executablePath);
application.StartInfo.Arguments = arguments;
application.StartInfo.WorkingDirectory = GetExpertPath();
application.Start();
if (wait)
{
if (!application.WaitForExit(waitingTime))
{
application.Kill();
}
else
{
success = true;
}
}
}
return success;
}
The code goes to application.Start()
but doesn't go to next line.
The process starts and ends well but my code is blocked.
Before this code, there are more process executions.
Testing only this code runs ok.
Using application.StartInfo.UseShellExecute = false;
the code goes to next step too.
Any idea?