System.Resources.ResourceManager.CreateFileBasedResourceManager Method

Returns a System.Resources.ResourceManager object that searches a specific directory instead of an assembly manifest for resources.

Syntax

public static ResourceManager CreateFileBasedResourceManager (string baseName, string resourceDir, Type usingResourceSet)

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. resourceDir can be an absolute path or a relative path from the application directory.
usingResourceSet
The type of the custom System.Resources.ResourceSet to use. If null, the default runtime System.Resources.ResourceSet object is used.

Returns

A new instance of a resource manager that searches the specified directory instead of an assembly manifest for resources.

Remarks

This method returns a resource manager that retrieves resources from a .resources file that is not embedded in an assembly. You can use this System.Resources.ResourceManager object to load resources for an ASP.NET page or to test a System.Resources.ResourceSet implementation. For an example that retrieves resources from a standalone .resources file, see the Retrieving Resources in Desktop Apps article.

This method lets you specify a System.Resources.ResourceSet implementation. If you do not want a specific System.Resources.ResourceSet implementation, but would like to use a custom resource file format, you should derive from the System.Resources.ResourceSet class, override the ResourceSet.GetDefaultReader and ResourceSet.GetDefaultWriter methods, and pass that type to this constructor.

Note:

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

Requirements

Namespace: System.Resources
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0