Process Fails while calling Start



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

.



Relevant Pages

  • Re: Return after AppActivate
    ... If I can terminate it then a message should be no big deal. ... from the TechNet Script library .. ... One such non-standard actX control for calling api's is called ... "DynaWrap", and that can be found on Gunter Born's website. ...
    (microsoft.public.scripting.wsh)
  • Re: Process Fails while calling Start
    ... I'm creating processes of a console based application. ... keeps waiting for some reponse from the process. ... The process is started when the control reaches proc.Start. ... Otherwise I need to terminate those threads if ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Ever had to judge a new to-be-hired in interview?
    ... Any reference to mentioned control will load the form ... form will not terminate, therefore form level variables are not reset. ... and then try it without the reference to Form2.Text1. ... Private Sub Command1_Click ...
    (microsoft.public.vb.general.discussion)
  • Re: Stopping a Thread
    ... If you do something that causes it to terminate, ... By the time you get to the destructor, the dialog and all its child controls are gone. ... The message handler for the GUI receives this message, and if it is in a shutdown ... >loads each record into a custom drawn list control. ...
    (microsoft.public.vc.mfc)
  • Re: Ever had to judge a new to-be-hired in interview?
    ... >> "Control contents will be lost when the form unloads, ... >>> End Sub ... >>> But the form never terminate. ... In an ActiveX that is also a data entry and manipulation interface, ...
    (microsoft.public.vb.general.discussion)