What happens when I interrupt my C# console application with Control-C?
Is the process killed? Is memory freed? Are finally
blocks executed? What happens to database connections?
Does any of this differ if the application is built for debug or release, or run inside/outside Visual Studio?
Short Answer: It's doing nothing after CTRL-C
Long Answer: There is good article about it on the MSDN which clearly states, that it sends a signal (interrupt) instead of keypress-events.
There is also a cancelKeyPress-Event triggered which you can subscribe to and do whatever you want!
Unluckily there is no more info about what's actually done by default. Maybe in the worst case you can check it out by yourself. But imo there should be some documentation about it...
UPDATE: Alois Kraus wrote a codeproject-Article about gracefully shuting down a console-application after receiving CTRL-C.
To quote Alois Kraus: