<p>What is the right way to perform some static finallization? </p>

<p>There is no static destructor. The <code>AppDomain.DomainUnload</code> event is not raised in the default domain. The <code>AppDomain.ProcessExit</code> event shares the total time of the three seconds (default settings) between all event handlers, so it's not really usable.</p>

Basically, you can't. Design your way around it to the fullest extent possible.
Don't forget that a program can
always
terminate abruptly anyway - someone pulling out the power being the obvious example. So anything you do has to be "best effort" - in which case I'd certainly
hope
that
```
AppDomain.ProcessExit
```
would be good enough.
What do you need to do, in your particular case?