How to get Task manager process closing events in c#?

Sachwet 1 Reputation point
2024-01-16T07:32:06.79+00:00

Hi Team
I am Implimenting a server(APIGatewat.exe which is console exe) to launch other console exe(act as other servers)  in background without 
user intercation mode
i am able to launch the exe(using process start) but when im closing my Main exe in background (like if exe get close in task manager or if it get close by other UI tool)
my other exe are not getting close when i use the cross mark in corner to close other exe also gets close for this im using event

            AppDomain.CurrentDomain.ProcessExit += new EventHandler(ProcessExitHandler);

anyone have idea how we can handle taskmanager process cloing events? or any other solution

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,922 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,614 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,015 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
343 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.