views:

63

answers:

1

I am starting a process lets say abc.exe in a background worker. In the beginning everything works fine but in between the newly created process i.e. abc.exe halts. Although I am starting abc.exe as hidden window but I come to know about its hang as it stops doing log writing.

When I close my UI form then again abc.exe starts working.

Can anybody tell me what could be the possible cause for this?

I am not able to debug the issue as it can happen at any time, I can not replicate it.

Please tell me as it is very urgent for me. If some more info is required then please revert back.

+2  A: 

This has nothing to do with background worker which is for creating threads, not processes. I suspect you are trying to use the StdIn/StdOut of the process you created?

It is common for a process to hang like that if you aren't reading from the standard output stream correctly. There's an example of how to do this correctly and avoid deadlocks on MSDN.

Josh Einstein
I suppose you are saying right because I tried to read the output sent by abc.exe but that did not worked. I will remove that part then will try again and let you know. But thanks for your quick reply as it has given me new hope.
Dharmendra
Did this work.?
Josh Einstein