I would like to start a process using:
ProcessStartInfo createProject = new ProcessStartInfo();
createProject.FileName = exePath;
createProject.UseShellExecute = false;
createProject.WorkingDirectory = projectDirectory;
createProject.Arguments = exeArguments;
try
{
// Start the process with the info specified.
System.Diagnostics.Process.Start(createProject);
}
catch (IOException eX)
{
// Log error.
MessageBox.Show("Unable to create project", "Error Creating Project");
}
When I put a breakpoint at the line of Process.Start()
and continue with step over by pressing F10, then the process runs without any problem.
However when I press F5 at the breakpoint or just run my application without any breakpoints, I get a "Your application has stopped working" dialog, without my application throwing any exception.
I tried also using Thread.Sleep()
before the Process.Start()
which has no result.
I really wonder what causes this problem.
EDIT: After I check the event viewer, I see that the faulting module is MSVCR90.dll. I have the version 9.0.30729.6161 installed.