- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
Closed
Labels
area-System.Diagnostics.Processbughelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
Milestone
Description
Description
Process.GetProcessById should throw an ArgumentException if the process isn't running, but it doesn't seem to be the case with .NET Core 3.1 as the method always returns previously killed process (please check repro below).
Am I missing something ?
Reproduction Steps
        [Test] public void TestKillProcess()
        {
            var p = new Process();
            p.StartInfo.FileName = "cmd.exe";
            p.Start();
            var pid = p.Id;
            p.Kill();
            Assert.Throws<ArgumentException>(() => Process.GetProcessById(pid));
        }Expected behavior
Test should pass as in .NET Framework 4.8
Actual behavior
Regression?
It works on .NET Framework 4.8.
Configuration
- .NET Core 3.1
- Windows 10
- x64
Other information
No response
Metadata
Metadata
Assignees
Labels
area-System.Diagnostics.Processbughelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributors
