ServerManager.Dispose Method ()


Releases all resources used by the ServerManager class.

Namespace:   Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)

public void Dispose()

Calling the Dispose method invalidates cached configuration system values.

Call M:Namespace.Class.Dispose when you are finished using the ServerManager. The M:Namespace.Class.Dispose method leaves the ServerManager in an unusable state. After calling M:Namespace.Class.Dispose, you must release all references to the ServerManager so the garbage collector can reclaim the memory that the ServerManager was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.


Always call M:Namespace.Class.Dispose before you release your last reference to the ServerManager. Otherwise, the resources it is using will not be freed until the garbage collector calls the ServerManager object's Finalize method.

Return to top