What is the right way to perform some static finallization?
There is no static destructor. The AppDomain.DomainUnload
event is not raised in the default domain. The AppDomain.ProcessExit
event shares the total time of the three seconds (default settings) between all event handlers, so it's not really usable.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…