Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ResourceManager.ReleaseAllResources Method

Tells the resource manager to call the Close method 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 app. Any future resource lookups on this ResourceManager object will be as expensive as the first lookup, because the resource manager will have to search and load resources again. This can be useful in some complex threading scenarios, where creating a new ResourceManager object is the appropriate behavior.

NoteNote

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

You can also use this method in situations where the managed instances for the resources created by the current resource manager have to be released deterministically, without waiting for the resource manager to go completely out of scope and be garbage collected.

NoteNote

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

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft