Export (0) Print
Expand All

ResourceManager.ReleaseAllResources Method

Tells the ResourceManager to call Close on all ResourceSet objects and release all resources.

Namespace:  System.Resources
Assembly:  mscorlib (in mscorlib.dll)

public virtual void ReleaseAllResources()

This method will shrink the working set in a running application. Any future resource lookups on this ResourceManager will be as extensive as the first lookup, since it will need to search and load resources again. This can be useful in some complex threading scenarios, where creating a new ResourceManager is the appropriate behavior.

NoteNote:

Starting with the .NET Framework version 2.0, the ReleaseAllResources method is not threadsafe with respect to GetObject, GetString, and GetStream operations. The advantage of this change is a performance improvement for multiple threads accessing resources. The disadvantage is if you call the ReleaseAllResources method in one thread while simultaneously getting a resource in another thread, the get operation can throw ObjectDisposedException.

This method can also be used in situations where the managed instances for these resources created by the current ResourceManager have to be released deterministically, without waiting for the ResourceManager to go completely out of scope and be garbage collected.

NoteNote:

Calling this method does not unload satellite assemblies. To unload satellite assemblies, use Unload.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

XNA Framework

Supported in: 3.0, 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft