expose WaitHandle from System.Diagnostics.Process - by Ben Voigt

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 628663 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 12/5/2010 5:06:07 PM
Access Restriction Public


Right now after calling Process.Start, it is only possible to wait for the process to end by calling Process.WaitForExit.  In many circumstances, it would be useful to wait for one of a set of processes to exit, or wait for either a process exit or another event.  WaitHandle.WaitAny would be ideal for this purpose, but the ProcessWaitHandle class used inside Process.WaitForExit has internal accessibility and not available to developers.

Clearly other users want this, e.g. in https://connect.microsoft.com/VisualStudio/feedback/details/523489/process-exited-event-doesnt-fired-when-process-exits the user was trying to workaround the fact that ProcessWaitHandle isn't exposed.

Here is another situation where a Process.WaitHandle property would provide a superior solution: http://stackoverflow.com/questions/4360720/spawn-processes-but-only-5-at-a-time
Sign in to post a comment.
Posted by ixman on 1/20/2014 at 2:57 AM
Had similar problem and found a solution by using Job Objects API. If you add the child process in a job then you can subscribe to an event to "see" when the process goes away.

Posted by Microsoft on 2/21/2013 at 8:46 AM
Hi Ben,

Sorry for that. The issue got close due to an automated tool. We are not going to be able to address this issue in our next release due to other priorities.

Immo Landwerth
.NET Framework team
Posted by Ben Voigt on 2/11/2013 at 10:15 AM
This really illustrates the problem with Microsoft Connect. This issue just got closed, there hasn't been a comment in years, and there's never been any content addressing the technical merit. Bravo, you succeeded in improving your metric "unresolved issues" in the one way that's virtually guaranteed to upset customers.
Posted by Microsoft on 12/5/2010 at 5:25 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)