This documentation is archived and is not being maintained.

ResourceManager.CreateFileBasedResourceManager Method

Returns a ResourceManager that searches a specific directory for resources instead of in the assembly manifest.

[Visual Basic]
Public Shared Function CreateFileBasedResourceManager( _
   ByVal baseName As String, _
   ByVal resourceDir As String, _
   ByVal usingResourceSet As Type _
) As ResourceManager
[C#]
public static ResourceManager CreateFileBasedResourceManager(
 string baseName,
 string resourceDir,
 Type usingResourceSet
);
[C++]
public: static ResourceManager* CreateFileBasedResourceManager(
 String* baseName,
 String* resourceDir,
 Type* usingResourceSet
);
[JScript]
public static function CreateFileBasedResourceManager(
   baseName : String,
 resourceDir : String,
 usingResourceSet : Type
) : ResourceManager;

Parameters

baseName
The root name of the resources. For example, the root name for the resource file named "MyResource.en-US.resources" is "MyResource".
resourceDir
The name of the directory to search for the resources.
usingResourceSet
The Type of the custom ResourceSet to use. If a null reference (Nothing in Visual Basic), the default runtime ResourceSet is used.

Return Value

The newly created ResourceManager that searches a specific directory for resources instead of in the assembly manifest.

Exceptions

Exception Type Condition
ArgumentException The baseName ends in .resources.
ArgumentNullException The baseName parameter is a null reference (Nothing in Visual Basic).

Remarks

This method returns a ResourceManager that is not dependent on any particular assembly. The returned ResourceManager can be used to load resources for an ASP.NET page or for testing a ResourceSet implementation.

You can specify a ResourceSet implementation. 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.

CAUTION   Using standalone .resources files in an ASP.NET application will break XCOPY deployment because the resources remain locked until they are explicitly released by the ReleaseAllResources method. If you want to deploy resources into ASP.NET applications, compile your .resources into satellite assemblies.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

.NET Framework Security: 

See Also

ResourceManager Class | ResourceManager Members | System.Resources Namespace

Show: