Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to add a method that kills the process tree? #74198

Closed
ymh199478 opened this issue Sep 23, 2019 · 9 comments
Closed

Is it possible to add a method that kills the process tree? #74198

ymh199478 opened this issue Sep 23, 2019 · 9 comments

Comments

@ymh199478
Copy link

.Net standard does not provide any method to kill a process tree.

@jonstelly
Copy link

jonstelly commented Sep 23, 2019

I was just updating some projects to .NET Core 3.0 and coming here to ask the same. I had assumed dotnet core 3.0's Process.Kill(bool) method would be included in .NET Standard 2.1 but it doesn't seem to be.

Dotnet Core Issue
Dotnet Core Pull Request

I have some shared Process code that was in a .NET Standard 2.0 library using my own hacky way of killing a process tree. I had anticipated removing it and switching to the .NET Core 3.0 method, but I guess I'll have to hold off on that. It would be really helpful to have this in .NET Standard

@darkguy2008
Copy link

I know some people don't like +1ing but I would like the same feature too. I had some hackish code too to do that using ManagementObjectSearcher but it threw a StackOverflowException on me. I really don't know why in .NET Core we're encouraged to use .NET Standard for Class Libraries when they don't have the same features found in .NET Core, so that is kind of a deal-breaker for my library today.

Any chances we can get this? How to make this issue get attention?

@Happypig375
Copy link
Member

Just wait for .NET 5... I doubt a new .NET Standard will exist if .NET 5 is coming.

@darkguy2008
Copy link

darkguy2008 commented May 28, 2020

Just wait for .NET 5... I doubt a new .NET Standard will exist if .NET 5 is coming.

Uh, yeah, well, I make apps for a living, so "just waiting" isn't exactly a solution. I bet there might be good things with .NET 5, but I don't think my bills could wait for its release.

For now all I did was to raise an event when the process needs to be killed, then the .NET Core app catches it along with the process Id and then calls process.kill(id) instead. Hackish, but it keeps going.

Still, I'm a bit baffled that .NET Standard lacks such a basic feature... even moreso when it's been implemented already in .NET Core which is multiplatform already, so I dunno what's the reasoning behind not doing it in .NET Standard.

@terrajobst
Copy link
Member

Moving to dotnet/runtime as this as an API request.

@terrajobst terrajobst transferred this issue from dotnet/standard Aug 18, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 18, 2022
@ghost
Copy link

ghost commented Aug 18, 2022

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.

Issue Details

.Net standard does not provide any method to kill a process tree.

Author: ymh199478
Assignees: -
Labels:

area-System.Diagnostics.Process

Milestone: -

@jozkee
Copy link
Member

jozkee commented Aug 19, 2022

This issue is asking to port Process.Kill(bool entireProcessTree) to standard, but AFAIK there are no plans of a netstandard2.2.

@jozkee jozkee closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 19, 2022
@terrajobst terrajobst reopened this Aug 19, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 19, 2022
@terrajobst
Copy link
Member

That's why I moved to dotnet/runtime. We should treat it as a feature request for Process.

@terrajobst
Copy link
Member

Never mind. I just realized we already have the API in .NET 5.

@terrajobst terrajobst closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 19, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants