Solved

What type of exception is thrown in .NET when a process is killed via task manager?

Posted on 2014-12-11
4
127 Views
Last Modified: 2014-12-17
What type of exception is thrown in .NET when a process is killed via task manager?  I need to be able to differential when a process is killed vs. when a normal exception occurs.

Thanks in advance..
0
Comment
Question by:MRS
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40495276
What exception? Killing a process is killing a process.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 40495522
Put another way.  When killed via task manager no exception is thrown.  (Also if a program finishing via an execution is normal then you ought to have serious words with your programmers.  Exceptions are thrown when something critically bad and unexpected happens.)
0
 
LVL 11

Accepted Solution

by:
louisfr earned 500 total points
ID: 40495765
On the other hand, when you end a task (instead of killing the process) from the task manager, you can get CloseReason.TaskManagerClosing in the FormClosing event.
0
 

Author Closing Comment

by:MRS
ID: 40505249
Thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question