Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

IDTExtensibility2.OnDisconnection Method

Occurs whenever an add-in is unloaded from Visual Studio.

Namespace: Extensibility
Assembly: Extensibility (in extensibility.dll)

'Declaration
Sub OnDisconnection ( _
	<InAttribute> RemoveMode As ext_DisconnectMode, _
	<InAttribute> ByRef custom As Array _
)
'Usage
Dim instance As IDTExtensibility2
Dim RemoveMode As ext_DisconnectMode
Dim custom As Array

instance.OnDisconnection(RemoveMode, custom)
void OnDisconnection (
	/** @attribute InAttribute() */ ext_DisconnectMode RemoveMode, 
	/** @attribute InAttribute() */ /** @ref */ Array custom
)
JScript does not support passing value-type arguments by reference.

Parameters

RemoveMode

An ext_DisconnectMode enumeration value that informs an add-in why it was unloaded.

custom

An empty array that you can use to pass host-specific data for use after the add-in unloads.

OnDisconnection, which is similar to OnBeginShutdown, occurs whenever the add-in is unloaded, but the integrated development environment (IDE) remains running. (OnBeginShutdown occurs whenever the IDE is shut down, which necessarily unloads add-ins that are running.)

Public Sub OnDisconnection(ByVal disconnectMode As  _
ext_DisconnectMode, ByRef custom As Array) Implements _
IDTExtensibility2.OnDisconnection
    MsgBox("Place cleanup code here.")
End Sub

Community Additions

ADD
Show:
© 2015 Microsoft