Static Finalizer

后端 未结 5 906
无人共我
无人共我 2020-12-08 00:40

What is the right way to perform some static finallization?

There is no static destructor. The AppDomain.DomainUnload event is not raised in the defaul

5条回答
  •  悲&欢浪女
    2020-12-08 01:13

    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?

提交回复
热议问题