Hi all,
I'm creating processes of a console based application. After
proc.Start() the process is not getting terminated and the thread
keeps waiting for some reponse from the process. Now I need to kill
the process if it takes more time.
Process proc = new Process();
proc.StartInfo.FileName = "application";
proc.StartInfo.WorkingDirectory = workingdir;
proc.StartInfo.Arguments = " args1 arg2";
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
logger.Debug("Parameters used : " + proc.StartInfo.Arguments);
proc.Start();
proc.WaitForExit();
proc.Dispose();
The process is started when the control reaches proc.Start(). Hope the
control should move to the next statement proc.WaitForExit() and wait
until the process gets completed. The control is not moving out of the
statement.
When I look at the threads from .NET IDE, I could see a thread still
active for this call. No further execution is allowed from this point.
Any clue why this is failing?
How can I do this? Otherwise I need to terminate those threads if
running for more time.
Thanks