(There is a very similar topic that never got solved: here)
We have a big app running on several clients, but recently some of my code stopped working. Adding some debug code I found out the code stops at a call to Process.Start() (with no shellexecute=true set).
The call is a simple
Process.Start(new ProcessStartInfo("program"))
in a BackgroundWorker thread.
The "program" app does what it should do and exits.
Our application continues as the thread is in the background but if the application runs another Process.Start on the GUI thread, the app locks up. If the application is closed with the X button the app still shows in taskmanager as the thread is still blocked by the Process.Start.
The problem is that this behavior can not be reproduced. It happens randomly on some clients computers.
What could happen to make Process.Start() hang? (Program.Main is marked with [STAThread] )
I have currently just made a workaround that launches the Process.Start() in its own thread, killing it after 5 seconds if it has not returned by then. But that is 5 seconds to much for the user waiting for the code to return ( I do not know how low i can set the timeout as I need the return value on Process.Start() in some cases ).
Can there be antivirus softwares interfering? (the clients has Symantec AV installed)
UPDATE: I assumed that when i did a
ProcessStartInfo psi = new ProcessStartInfo("ping", "localhost");
that psi.UseShellExecute was FALSE by default... This is not correct. It defaults to TRUE. Is this normal?