Dispose Method

DTF API

Copy image CopyHover image
Deployment Tools Foundation Dispose Method
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerInstallerHandleDispose()()()()
Closes the handle. After closing a handle, further method calls may throw an InvalidHandleException.
Declaration Syntax
C# Visual Basic Visual C++ F#
public void Dispose()
Public Sub Dispose
public:
virtual void Dispose() sealed
abstract Dispose : unit -> unit 
override Dispose : unit -> unit 
Remarks

The finalizer of this class will NOT close the handle if it is still open, because finalization can run on a separate thread from the application, resulting in potential problems if handles are closed from that thread. It is best that the handle be closed manually as soon as it is no longer needed, as leaving lots of unused handles open can degrade performance.

Win32 MSI API: MsiCloseHandle

See Also

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.11.1.2318)