terminating `dotnet run` doesn't terminate child
See original GitHub issueSteps to reproduce
[Terminal 1]
$ dotnet new razor
$ dotnet run
Hosting environment: Production
Content root path: /home/mistria/runtime-EclipseApplication/tst
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
[Terminal 2]
$ ps aux | grep dotnet
mistria 24040 2.2 0.7 3296988 88604 pts/0 SLl+ 12:07 0:01 dotnet run
mistria 24143 1.1 0.5 21300684 71156 pts/0 SLl+ 12:07 0:00 dotnet exec /home/mistria/runtime-EclipseApplication/tst/bin/Debug/netcoreapp2.0/tst.dll
$ kill -15 24040 #SIGTERM on host
$ ps aux | grep dotnet
mistria 24143 1.1 0.5 21300684 71156 pts/0 SLl+ 12:07 0:00 dotnet exec /home/mistria/runtime-EclipseApplication/tst/bin/Debug/netcoreapp2.0/tst.dll
# child still there like a zombie
Expected behavior
Child process terminated
Actual behavior
Child process is still there
This can be confusing for IDEs (like Eclipse IDE) which bind the “stop” button and other UI actions to the Terminate signal. In such case, the developer trying dotnet run
from the IDE will face issues because of the zombi-ish processes
Environment data
dotnet --info
output:
.NET Command Line Tools (2.0.1-servicing-006924)
Product Information:
Version: 2.0.1-servicing-006924
Commit SHA-1 hash: 1ed6be56ca
Runtime Environment:
OS Name: fedora
OS Version: 26
OS Platform: Linux
RID: fedora.26-x64
Base Path: /home/mistria/apps/dotnet-2/sdk/2.0.1-servicing-006924/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
Issue Analytics
- State:
- Created 6 years ago
- Reactions:25
- Comments:26 (8 by maintainers)
Top Results From Across the Web
terminating `dotnet run` doesn't terminate child · Issue #8610
After this, kill the project with Ctrl + C. Sometimes it successfully says Application is shutting down and then shuts down. Other times,...
Read more >How to properly stop running dotnet core web application?
I used Process Hacker to kill the dotnet.exe process but that doesn't seem right. What would be the best way to kill the...
Read more >Process.Kill Method (System.Diagnostics)
The Kill method forces a termination of the process, while CloseMainWindow only requests a termination. When a process with a graphical interface is ......
Read more >How to: Cancel a Task and Its Children | Microsoft Learn
See examples of how to cancel a task and its children in .NET. The examples cover steps from cancelable task creation, to the...
Read more >dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given ... host process and all of its child processes are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like this thread is still active but stale. It was originally open almost a year ago: do we have consensus that this is real and should be addressed somewhere and slotted for a future release?
@livarcocc
Steps to reproduce:
dotnet test
procexp.exe
and find parent donet.exeExpected
Actually