AppDomain.DomainUnload AppDomain.DomainUnload AppDomain.DomainUnload AppDomain.DomainUnload Event

定義

發生於將要卸載 AppDomain 時。Occurs when an AppDomain is about to be unloaded.

public:
 virtual event EventHandler ^ DomainUnload;
public event EventHandler DomainUnload;
member this.DomainUnload : EventHandler 
Public Custom Event DomainUnload As EventHandler 

實作

備註

這個EventHandler事件的委派可以在卸載應用程式域之前,執行任何終止活動。The EventHandler delegate for this event can perform any termination activities before the application domain is unloaded.

在卸載時需要執行處理的每個應用程式域,應該註冊此事件的事件處理常式。Each application domain that needs to perform processing when it is unloaded should register an event handler for this event. 不應使用共用事件處理常式,因為EventHandler委派不會識別要卸載的網域。A shared event handler should not be used, because the EventHandler delegate does not identify the domain that is being unloaded.

注意

這個事件永遠不會在預設應用程式域中引發。This event is never raised in the default application domain.

請不要對引發事件的執行緒進行假設。Do not make assumptions about the thread the event is raised on. 事件可以在不同的執行緒上引發,而不是呼叫Unload方法。The event can be raised on a different thread than the one that called the Unload method.

如需處理事件的詳細資訊, 請參閱處理和引發事件For more information about handling events, see Handling and Raising Events.

適用於