[Mono-bugs] [Bug 69869][Wis] Changed - Process.Kill crashes on closed process

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 27 Nov 2004 16:21:04 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by fawad@fawad.net.

http://bugzilla.ximian.com/show_bug.cgi?id=69869

--- shadow/69869	2004-11-27 16:17:12.000000000 -0500
+++ shadow/69869.tmp.11637	2004-11-27 16:21:04.000000000 -0500
@@ -45,6 +45,29 @@
 How often does this happen? Every time
 
 ------- Additional Comments From fawad@fawad.net  2004-11-27 16:17 -------
 Created an attachment (id=13329)
 Throw InvalidOperationException if no process is associated to the Process object.
 
+
+------- Additional Comments From fawad@fawad.net  2004-11-27 16:21 -------
+According to MSDN docs at
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDiagnosticsProcessClassKillTopic.asp,
+ InvalidOperationException should be thrown if the process has already
+exited, however .NET Framework 1.1 is throwing
+InvalidOperationException with the message
+
+There is no process associated with this Process object.
+
+which according to the docs is associated with the SystemException.
+
+Full stack trace in the test case:
+
+Unhandled Exception: System.InvalidOperationException: No process is
+associated with this object.
+   at System.Diagnostics.Process.EnsureState(State state)
+   at System.Diagnostics.Process.EnsureState(State state)
+   at System.Diagnostics.Process.GetProcessHandle(Int32 access,
+Boolean throwIfExited)
+   at System.Diagnostics.Process.GetProcessHandle(Int32 access)
+   at System.Diagnostics.Process.Kill()
+   at foo.Main()