Releases the resources used by the Package object.
Assembly: Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
The Dispose method is called when the VSPackage is being destroyed by Visual Studio. This is typically in response to a call to Close. (Neither Visual Studio nor the Package class implements a finalizer. Unless a separate finalizer is implemented, the Dispose method is always called with disposing set to true.)
A finalizer is a method that handles the destruction of unmanaged resources from within managed code. Finalizers run on a separate thread and impact the performance of the .NET Framework garbage collector, so you should avoid using them unnecessarily. For additional information on finalizers, see Finalize Methods and Destructors.
The default implementation of the Dispose method performs the following tasks:
Unregisters any registered editor factories.
Disposes any editor factories that also implement the IDisposable interface.
Disposes all dialog pages.
Revokes all services.
Disposes any services that implement the IDisposable interface.
If you override the Dispose method, be sure to call base.Dispose from within the overriding method.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.