This documentation is archived and is not being maintained.

ResourceManager Constructor (String, Assembly, Type)

Updated: September 2010

Initializes a new instance of the ResourceManager class that looks up resources contained in files derived from the specified root name using the given Assembly.

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

public ResourceManager(
	string baseName,
	Assembly assembly,
	Type usingResourceSet
)

Parameters

baseName
Type: System.String

The root name of the resource file without its extension and along with any fully qualified namespace name. For example, the root name for the resource file named "MyApplication.MyResource.en-US.resources" is "MyApplication.MyResource".

assembly
Type: System.Reflection.Assembly

The main assembly for the resources.

usingResourceSet
Type: System.Type

The Type of the custom ResourceSet to use. If null, the default runtime ResourceSet is used.

ExceptionCondition
ArgumentException

usingResourceset is not a derived class of ResourceSet.

ArgumentNullException

The baseName or assembly parameter is null.

The individual resource files should be contained in satellite assemblies with the invariant culture's .resources file contained in the main assembly. A satellite assembly is assumed to contain resources for a single culture specified in that assembly's manifest, and are loaded as necessary.

If the resource file identified by baseName cannot be found in assembly, the method instantiates a ResourceManager object, but the attempt to retrieve a specific resource throws an exception, typically a MissingManifestResourceException.

You can specify a ResourceSet implementation to be used. If you do not need a specific ResourceSet implementation but would like to use a custom resource file format, you should derive from the ResourceSet class, override GetDefaultReader and GetDefaultWriter, and pass that type to this constructor.

NoteNote:

The usingResourceSet parameter is used to support your own resource format, and will commonly be null. This is different from the constructor that takes a Type only.

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

Date

History

Reason

September 2010

Expanded the baseName parameter description and the Remarks section.

Customer feedback.

Show: