ResourceManager.CreateFileBasedResourceManager(String, String, Type) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a ResourceManager object that searches a specific directory instead of an assembly manifest for resources.
public:
static System::Resources::ResourceManager ^ CreateFileBasedResourceManager(System::String ^ baseName, System::String ^ resourceDir, Type ^ usingResourceSet);
public static System.Resources.ResourceManager CreateFileBasedResourceManager (string baseName, string resourceDir, Type? usingResourceSet);
public static System.Resources.ResourceManager CreateFileBasedResourceManager (string baseName, string resourceDir, Type usingResourceSet);
static member CreateFileBasedResourceManager : string * string * Type -> System.Resources.ResourceManager
Public Shared Function CreateFileBasedResourceManager (baseName As String, resourceDir As String, usingResourceSet As Type) As ResourceManager
- baseName
- String
The root name of the resources. For example, the root name for the resource file named "MyResource.en-US.resources" is "MyResource".
- resourceDir
- String
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
- Type
The type of the custom ResourceSet to use. If null
, the default runtime ResourceSet object is used.
A new instance of a resource manager that searches the specified directory instead of an assembly manifest for resources.
The baseName
or resourceDir
parameter is null
.
This method returns a resource manager that retrieves resources from a .resources file that is not embedded in an assembly. You can use this ResourceManager object to load resources for an ASP.NET page or to test a ResourceSet implementation. For an example that retrieves resources from a standalone .resources file, see the Retrieving Resources article.
This method lets you specify a ResourceSet implementation. If you do not want a specific ResourceSet implementation, but would like to use a custom resource file format, you should derive from the ResourceSet class, override the GetDefaultReader and GetDefaultWriter methods, and pass that type to this constructor.
Caution
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 ReleaseAllResources method. If you want to deploy resources with your ASP.NET apps, compile your .resources files into satellite assemblies.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: