AddInController.Shutdown Method

Definition

Disables an add-in.

public:
 void Shutdown();
public void Shutdown ();
member this.Shutdown : unit -> unit
Public Sub Shutdown ()

Examples

The following example obtains the AddInController object for a host view named manager and then shuts down the add-in.

AddInController ctrl = AddInController.GetAddInController(manager);
ctrl.Shutdown();
Dim ctrl As AddInController = AddInController.GetAddInController(manager)
ctrl.Shutdown()

Remarks

This method breaks the communication pipeline between an add-in and its host. If the add-in was activated in an automatically generated application domain by using the Activate<T>(AddInSecurityLevel) or Activate<T>(PermissionSet) methods, the Shutdown method also unloads the application domain.

If the add-in was loaded into its own application domain, the Shutdown method also unloads the application domain.

If the add-in was loaded into an existing application domain, the host and pipeline segments will no longer have any references to that add-in. In this case, the add-in will be eligible to be reclaimed by garbage collection.

You can also use this class to shut down an add-in that is activated in an external process.

Applies to