I want to serialise an object in C# if a user stops a console application.
I have seen various questions dealing with this, but no final answer.
I will need to catch Ctrl+c, clicking the top right corner and stop process from the task manager.
Is it safe if I have an implementation object and add this as a finalizer to it?
Just handle AppDomain.ProcessExit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With