mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Object System.Runtime.InteropServices.ComVisible(true)

The class retrieves resources from a binary .resources file that is embedded in an assembly or from a standalone .resources file. If an app has been localized and localized resources have been deployed in satellite assemblies, it looks up culture-specific resources, provides resource fallback when a localized resource does not exist, and supports resource serialization.

For more information about creating and managing resources in desktop apps and win8_appname_long apps, see the following sections:

Desktop Apps

Creating Resources

Instantiating a ResourceManager Object

ResourceManager and Culture-Specific Resources

Retrieving Resources

Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions

Resource Versioning

<satelliteassemblies> Configuration File Node

Windows Store Apps

## Desktop Apps

For desktop apps, the class retrieves resources from binary resource (.resources) files. Typically, a language compiler or the Assembly Linker (AL.exe) embeds these resource files in an assembly. You can also use a object to retrieve resources directly from a .resources file that is not embedded in an assembly, by using the method.

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 method. If you want to deploy resources with your ASP.NET apps, you should compile your .resources files into satellite assemblies.

In a resource-based app, one .resources file contains the resources of the default culture whose resources are used if no culture-specific resources can be found. For example, if an app's default culture is English (en), the English language resources are used whenever localized resources cannot be found for a specific culture, such as English (United States) (en-US) or French (France) (fr-FR). Typically, the resources for the default culture are embedded in the main app assembly, and resources for other localized cultures are embedded in satellite assemblies. Satellite assemblies contain only resources. They have the same root file name as the main assembly and an extension of .resources.dll. For apps whose assemblies are not registered in the global assembly cache, satellite assemblies are stored in an app subdirectory whose name corresponds to the assembly's culture.

## Creating Resources

When you develop a resource-based app, you store resource information in text files (files that have a .txt or .restext extension) or XML files (files that have a .resx extension). You then compile the text or XML files with the Resource File Generator (Resgen.exe) to create a binary .resources file. You can then embed the resulting .resources file in an executable or library by using a compiler option such as /resources for the C# and Visual Basic compilers, or you can embed it in a satellite assembly by using the Assembly Linker (Al.exe). If you include a .resx file in your Visual Studio project, Visual Studio handles the compilation and embedding of default and localized resources automatically as part of the build process.

Ideally, you should create resources for every language your app supports, or at least for a meaningful subset of each language. The binary .resources file names follow the naming convention basename.cultureName.resources, where basename is the name of the app or the name of a class, depending on the level of detail you want. The property is used to determine cultureName. A resource for the app's default culture should be named basename.resources.

For example, suppose that an assembly has several resources in a resource file that has the base name MyResources. These resource files should have names such as MyResources.ja-JP.resources for the Japan (Japanese) culture, MyResources.de.resources for the German culture, MyResources.zh-CHS.resources for the simplified Chinese culture, and MyResources.fr-BE.resources for the French (Belgium) culture. The default resource file should be named MyResources.resources. The culture-specific resource files are commonly packaged in satellite assemblies for each culture. The default resource file should be embedded in the app's main assembly.

Note that Assembly Linker allows resources to be marked as private, but you should always mark them as public so they can be accessed by other assemblies. (Because a satellite assembly contains no code, resources that are marked as private are unavailable to your app through any mechanism.)

For more information about creating, packaging, and deploying resources, see the articles Creating Resource Files, Creating Satellite Assemblies, and Packaging and Deploying Resources.

## Instantiating a ResourceManager Object

You instantiate a object that retrieves resources from an embedded .resources file by calling one of its class constructor overloads. This tightly couples a object with a particular .resources file and with any associated localized .resources files in satellite assemblies.

The two most commonly called constructors are:

looks up resources based on two pieces of information that you supply: the base name of the .resources file and the assembly in which the default .resources file resides. The base name includes the namespace and root name of the .resources file, without its culture or extension. Note that .resources files that are compiled from the command line typically do not include a namespace name, whereas .resources files that are created in the Visual Studio environment do. For example, if a resource file is named MyCompany.StringResources.resources and the constructor is called from a static method named Example.Main, the following code instantiates a object that can retrieve resources from the .resources file:

code reference: Conceptual.Resources.Retrieving#1

looks up resources in satellite assemblies based on information from a type object. The type's fully qualified name corresponds to the base name of the .resources file without its file name extension. In desktop apps that are created by using the Visual Studio Resource Designer, Visual Studio creates a wrapper class whose fully qualified name is the same as the root name of the .resources file. For example, if a resource file is named MyCompany.StringResources.resources and there is a wrapper class named MyCompany.StringResources, the following code instantiates a object that can retrieve resources from the .resources file:

code reference: Conceptual.Resources.Retrieving#2

If the appropriate resources cannot be found, the constructor call creates a valid object. However, the attempt to retrieve a resource throws a exception. For information about dealing with the exception, see the Handling MissingManifestResourceException and MissingSatelliteAssembly Exceptions section later in this article.

The following example shows how to instantiate a object. It contains the source code for an executable named ShowTime.exe. It also includes the following text file named Strings.txt that contains a single string resource, TimeHeader:

`TimeHeader=The current time is`

You can use a batch file to generate the resource file and embed it into the executable. Here's the batch file to generate an executable by using the C# compiler:

`resgen strings.txt csc ShowTime.cs /resource:strings.resources`

For the Visual Basic compiler, you can use the following batch file:

`resgen strings.txt vbc ShowTime.vb /resource:strings.resources`

code reference: System.Resources.ResourceManager.Class#1

## ResourceManager and Culture-Specific Resources

A localized app requires resources to be deployed as discussed in the article Packaging and Deploying Resources in Desktop Apps. If the assemblies are properly configured, the resource manager determines which resources to retrieve based on the current thread's property. (That property also returns the current thread's UI culture.) For example, if an app is compiled with default English language resources in the main assembly and with French and Russian language resources in two satellite assemblies, and the property is set to fr-FR, the resource manager retrieves the French resources.

You can set the property explicitly or implicitly. The way you set it determines how the object retrieves resources based on culture:

If you explicitly set the property to a specific culture, the resource manager always retrieves the resources for that culture, regardless of the user's browser or operating system language. Consider an app that is compiled with default English language resources and three satellite assemblies that contain resources for English (United States), French (France), and Russian (Russia). If the property is set to fr-FR, the object always retrieves the French (France) resources, even if the user's operating system language is not French. Make sure that this is the desired behavior before you set the property explicitly.

In ASP.NET apps, you must set the property explicitly, because it is unlikely that the setting on the server will match incoming client requests. An ASP.NET app can set the property explicitly to the user's browser accept language.

Explicitly setting the property defines the current UI culture for that thread. It does not affect the current UI culture of any other threads in an app.

You can set the UI culture of all threads in an app domain by assigning a object that represents that culture to the static property.

If you do not explicitly set the current UI culture and you do not define a default culture for the current app domain, the property is set implicitly by the Windows GetUserDefaultUILanguage function. This function is provided by the Multilingual User Interface (MUI), which enables the user to set the default language. If the UI language is not set by the user, it defaults to the system-installed language, which is the language of operating system resources.

The following simple "Hello world" example sets the current UI culture explicitly. It contains resources for three cultures: English (United States) or en-US, French (France) or fr-FR, and Russian (Russia) or ru-RU. The en-US resources are contained in a text file named Greetings.txt:

`HelloString=Hello world!`

The fr-FR resources are contained in a text file named Greetings.fr-FR.txt:

`HelloString=Salut tout le monde!`

The ru-RU resources are contained in a text file named Greetings.ru-RU.txt:

`HelloString=Всем привет!`

Here's the source code for the example (Example.vb for the Visual Basic version or Example.cs for the C# version):

code reference: Conceptual.Resources.CurrentCulture#1

To compile this example, create a batch (.bat) file that contains the following commands and run it from the command prompt. If you're using C#, specify csc instead of vbc and Example.cs instead of Example.vb.

`resgen Greetings.txt vbc Example.vb /resource:Greetings.resources resgen Greetings.fr-FR.txt Md fr-FR al /embed:Greetings.fr-FR.resources /culture:fr-FR /out:fr-FR\Example.resources.dll resgen Greetings.ru-RU.txt Md ru-RU al /embed:Greetings.ru-RU.resources /culture:ru-RU /out:ru-RU\Example.resources.dll`

## Retrieving Resources

You call the and methods to access a specific resource. You can also call the method to retrieve non-string resources as a byte array. By default, in an app that has localized resources, these methods return the resource for the culture determined by the current UI culture of the thread that made the call. See the previous section, ResourceManager and Culture-Specific Resources, for more information about how the current UI culture of a thread is defined. If the resource manager cannot find the resource for the current thread's UI culture, it uses a fallback process to retrieve the specified resource. If the resource manager cannot find any localized resources, it uses the resources of the default culture. For more information about resource fallback rules, see the "Resource Fallback Process" section of the article Packaging and Deploying Resources.

If the .resources file specified in the class constructor cannot be found, the attempt to retrieve a resource throws a or exception. For information about dealing with the exception, see the Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions section later in this topic.

The following example uses the method to retrieve culture-specific resources. It consists of resources compiled from .txt files for the English (en), French (France) (fr-FR), and Russian (Russia) (ru-RU) cultures. The example changes the current culture and current UI culture to English (United States), French (France), Russian (Russia), and Swedish (Sweden). It then calls the method to retrieve the localized string, which it displays along with the current day and month. Notice that the output displays the appropriate localized string except when the current UI culture is Swedish (Sweden). Because Swedish language resources are unavailable, the app instead uses the resources of the default culture, which is English.

The example requires the text-based resource files listed in following table. Each has a single string resource named DateStart.

Culture

File name

Resource name

Resource value

en-US

DateStrings.txt

DateStart

Today is

fr-FR

DateStrings.fr-FR.txt

DateStart

Aujourd'hui, c'est le

ru-RU

DateStrings.ru-RU.txt

DateStart

Сегодня

Here's the source code for the example (ShowDate.vb for the Visual Basic version or ShowDate.cs for the C# version of the code).

code reference: System.Resources.ResourceManager.Class#2

To compile this example, create a batch file that contains the following commands and run it from the command prompt. If you're using C#, specify csc instead of vbc and showdate.cs instead of showdate.vb.

`resgen DateStrings.txt vbc showdate.vb /resource:DateStrings.resources md fr-FR resgen DateStrings.fr-FR.txt al /out:fr-FR\Showdate.resources.dll /culture:fr-FR /embed:DateStrings.fr-FR.resources md ru-RU resgen DateStrings.ru-RU.txt al /out:ru-RU\Showdate.resources.dll /culture:ru-RU /embed:DateStrings.ru-RU.resources`

There are two ways to retrieve the resources of a specific culture other than the current UI culture:

You can call the , , or method to retrieve a resource for a specific culture. If a localized resource cannot be found, the resource manager uses the resource fallback process to locate an appropriate resource.

You can call the method to obtain a object that represents the resources for a particular culture. In the method call, you can determine whether the resource manager probes for parent cultures if it is unable to find localized resources, or whether it simply falls back to the resources of the default culture. You can then use the methods to access the resources (localized for that culture) by name, or to enumerate the resources in the set.

## Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions

If you try to retrieve a specific resource, but the resource manager cannot find that resource and either no default culture has been defined or the resources of the default culture cannot be located, the resource manager throws a exception if it expects to find the resources in the main assembly or a if it expects to find the resources in a satellite assembly. Note that the exception is thrown when you call a resource retrieval method such as or , and not when you instantiate a object.

The exception is typically thrown under the following conditions:

The appropriate resource file or satellite assembly does not exist. If the resource manager expects the app's default resources to be embedded in the main app assembly, they are absent. If the attribute indicates that the app's default resources reside in a satellite assembly, that assembly cannot be found. When you compile your app, make sure that resources are embedded in the main assembly or that the necessary satellite assembly is generated and is named appropriately. Its name should take the form appName.resources.dll, and it should be located in a directory named after the culture whose resources it contains.

Your app doesn't have a default or neutral culture defined. Add the attribute to a source code file or to the project information file (AssemblyInfo.vb for a Visual Basic app or AssemblyInfo.cs for a C# app) file.

The parameter in the constructor does not specify the name of a .resources file. The name should include the resource file's fully qualified namespace but not its file name extension. Typically, resource files that are created in Visual Studio include namespace names, but resource files that are created and compiled at the command prompt do not. You can determine the names of embedded .resources files by compiling and running the following utility. This is a console app that accepts the name of a main assembly or satellite assembly as a command-line parameter. It displays the strings that should be provided as the parameter so that the resource manager can correctly identify the resource.

code reference: System.Resources.ResourceManager.Class#4

If you are changing the current culture of your application explicitly, you should also remember that the resource manager retrieves a resource set based on the value of the property, and not the property. Typically, if you change one value, you should also change the other.

## Resource Versioning

Because the main assembly that contains an app's default resources is separate from the app's satellite assemblies, you can release a new version of your main assembly without redeploying the satellite assemblies. You use the attribute to use existing satellite assemblies and instruct the resource manager not to redeploy them with a new version of your main assembly,

For more information about versioning support for satellite assemblies, see the article Retrieving Resources.

## <satelliteassemblies> Configuration File Node

For executables that are deployed and run from a website (HREF .exe files), the object may probe for satellite assemblies over the web, which can hurt your app's performance. To eliminate the performance problem, you can limit this probing to the satellite assemblies that you have deployed with your app. To do this, you create a <satelliteassemblies> node in your app's configuration file to specify that you have deployed a specific set of cultures for your app, and that the object should not try to probe for any culture that is not listed in that node.

The preferred alternative to creating a <satelliteassemblies> node is to use the ClickOnce Deployment Manifest feature.

In your app's configuration file, create a section similar to the following:

`<?xml version ="1.0"?> <configuration> <satelliteassemblies> <assembly name="MainAssemblyName, Version=versionNumber, Culture=neutral, PublicKeyToken=null|yourPublicKeyToken"> <culture>cultureName1</culture> <culture>cultureName2</culture> <culture>cultureName3</culture> </assembly> </satelliteassemblies> </configuration>`

Edit this configuration information as follows:

Specify one or more <assembly> nodes for each main assembly that you deploy, where each node specifies a fully qualified assembly name. Specify the name of your main assembly in place of MainAssemblyName, and specify the Version, PublicKeyToken, and Culture attribute values that correspond to your main assembly.

For the Version attribute, specify the version number of your assembly. For example, the first release of your assembly might be version number 1.0.0.0.

For the PublicKeyToken attribute, specify the keyword null if you have not signed your assembly with a strong name, or specify your public key token if you have signed your assembly.

For the Culture attribute, specify the keyword neutral to designate the main assembly and cause the class to probe only for the cultures listed in the <culture> nodes.

For more information about fully qualified assembly names, see the article Assembly Names. For more information about strong-named assemblies, see the article Creating and Using Strong-Named Assemblies.

Specify one or more <culture> nodes with a specific culture name, such as "fr-FR", or a neutral culture name, such as "fr".

If resources are needed for any assembly not listed under the <satelliteassemblies> node, the class probes for cultures using standard probing rules.

## win8_appname_long Apps

Although the class is supported in win8_appname_long apps, we do not recommend its use. Use this class only when you develop net_portable projects that can be used with win8_appname_long apps. To retrieve resources from win8_appname_long apps, use the Windows.ApplicationModel.Resources.ResourceLoader class instead.

For win8_appname_long apps, the class retrieves resources from package resource index (PRI) files. A single PRI file (the application package PRI file) contains the resources for both the default culture and any localized cultures. You use the MakePRI utility to create a PRI file from one or more resource files that are in XML resource (.resw) format. For resources that are included in a Visual Studio project, Visual Studio handles the process of creating and packaging the PRI file automatically. You can then use the .NET Framework class to access the app's or library's resources.

You can instantiate a object for a win8_appname_long app in the same way that you do for a desktop app.

You can then access the resources for a particular culture by passing the name of the resource to be retrieved to the method. By default, this method returns the resource for the culture determined by the current UI culture of the thread that made the call. You can also retrieve the resources for a specific culture by passing the name of the resource and a object that represents the culture whose resource is to be retrieved to the method. If the resource for the current UI culture or the specified culture cannot be found, the resource manager uses a UI language fallback list to locate a suitable resource.

Represents a resource manager that provides convenient access to culture-specific resources at run time.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  This constructor is useful only if you write your own class that derives from the class.

  Initializes a new instance of the class with default values.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  ## Desktop Apps

  In desktop apps, the resource manager uses the parameter to load a particular resource file as follows:

  If the attribute is not used to indicate that the resources of the default culture reside in a satellite assembly, the resource manager assumes that the resource file for the default culture is found in the same assembly as the type specified by the parameter.

  The resource manager assumes that the default resource file has the same base name as the type specified by the parameter.

  The resource manager uses the default class to manipulate the resource file.

  For example, given a type named MyCompany.MyProduct.MyType, the resource manager looks for a .resources file named MyCompany.MyProduct.MyType.resources in the assembly that defines MyType.

  In Visual Studio, the Resource Designer automatically generates code that defines an internal (in C#) or Friend (in Visual Basic) class whose name is the same as the base name of the .resources file for the default culture. This makes it possible to instantiate a object and couple it with a particular set of resources by getting a type object whose name corresponds to the name of the resource, because as long as the class is visible to the compiler, the resources must be as well. For example, if a .resources file is named Resource1, the following statement instantiates a object to manage the .resources file named Resource1:

  code reference: System.Resources.ResourceManager.ctor#2

  If you're not using Visual Studio, you can create a class with no members whose namespace and name are the same as that of the default .resources file. The example provides an illustration.

  ## win8_appname_long Apps

  Although the class is supported in win8_appname_long apps, we do not recommend its use. Use this class only when you develop net_portable projects that can be used with win8_appname_long apps. To retrieve resources from win8_appname_long apps, use the Windows.ApplicationModel.Resources.ResourceLoader class instead.

  In win8_appname_long apps, uses the parameter to infer the assembly, base name, and the namespace where the resource items can be located within the app's package resource index (PRI) file. For example, given a type named MyCompany.MyProduct.MyType that is defined in MyAssembly, the resource manager looks for a resource set identifier named MyAssembly and looks for a scope MyCompany.MyProduct.MyType within that resource set. The resource manager searches for resource items under the default context (current culture, current high contrast setting, and so on) within this scope.

  Initializes a new instance of the class that looks up resources in satellite assemblies based on information from the specified type object.

  A type from which the resource manager derives all information for finding .resources files.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  ## Desktop Apps

  In desktop apps, the individual culture-specific resource files should be contained in satellite assemblies, and the default culture's resource file should be contained in the main assembly. A satellite assembly is assumed to contain resources for a single culture specified in that assembly's manifest, and is loaded as necessary.

  To retrieve resources from .resources files directly instead of retrieving them from assemblies, you must call the method instead to instantiate a object.

  If the resource file identified by cannot be found in , the method instantiates a object, but the attempt to retrieve a specific resource throws an exception, typically . For information about diagnosing the cause of the exception, see the "Handling the MissingManifestResourceException Exception" section of the class topic.

  ## win8_appname_long Apps

  Although the class is supported in win8_appname_long apps, we do not recommend its use. Use this class only when you develop net_portable projects that can be used with win8_appname_long apps. To retrieve resources from win8_appname_long apps, use the Windows.ApplicationModel.Resources.ResourceLoader class instead.

  In win8_appname_long apps, the resource manager uses the simple name of the parameter to look up a matching resource set in the app's package resource index (PRI) file. The parameter is used to look up a resource item within the resource set. For example, the root name for PortableLibrary1.Resource1.de-DE.resources is PortableLibrary1.Resource1.

  Initializes a new instance of the class that looks up resources contained in files with the specified root name in the given assembly.

  The root name of the resource file without its extension but including any fully qualified namespace name. For example, the root name for the resource file named MyApplication.MyResource.en-US.resources is MyApplication.MyResource.
  The main assembly for the resources.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

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

  To retrieve resources from .resources files directly instead of retrieving them from assemblies, you must call the method instead to instantiate a object.

  If the resource file identified by cannot be found in , the method instantiates a object, but the attempt to retrieve a specific resource throws an exception, typically . For information about diagnosing the cause of the exception, see the "Handling the MissingManifestResourceException Exception" section of the class topic.

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

  Initializes a new instance of the class that uses a specified class to look up resources contained in files with the specified root name in the given assembly.

  The root name of the resource file without its extension but including any fully qualified namespace name. For example, the root name for the resource file named MyApplication.MyResource.en-US.resources is MyApplication.MyResource.
  The main assembly for the resources.
  The type of the custom to use. If null, the default runtime object is used.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added: an object of type 'string'

  The property reflects the fully qualified namespace name and the root resource name of a resource file, without its culture or file name extension. For example, if an app's default resource file is named SampleApps.StringResources.resources, the value of the property is "SampleApps.StringResources". If an app's default resource file is named SampleApps.StringResources.en-US.resources and is embedded in a satellite assembly, the value of the property is still "SampleApps.StringResources".

  The property value of a resource file that is compiled and embedded from the command line does not include a namespace name unless you explicitly include one when compiling the file. On the other hand, the property value of a resource file that is compiled and embedded within the Visual Studio environment typically does include the default namespace name.

  The property value is the same as the string passed to the or constructor when instantiating a instance.

  Gets the root name of the resource files that the searches for resources.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  The field is useful only if you write your own class that derives from the class.

  Specifies the root name of the resource files that the searches for resources.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Resources.ResourceManager `` `` ``

  This method returns a resource manager that retrieves resources from a .resources file that is not embedded in an assembly. You can use this object to load resources for an ASP.NET page or to test a 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 implementation. If you do not want a specific implementation, but would like to use a custom resource file format, you should derive from the class, override the and methods, and pass that type to this constructor.

  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 method. If you want to deploy resources with your ASP.NET apps, compile your .resources files into satellite assemblies.

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

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

  The root name of the resources. For example, the root name for the resource file named "MyResource.en-US.resources" is "MyResource". The name of the directory to search for the resources. can be an absolute path or a relative path from the application directory. The type of the custom to use. If null, the default runtime object is used.
- Property
  2.0.0.0
  4.0.0.0
  System.Resources.UltimateResourceFallbackLocation To be added.

  The property is useful only if you write your own class that derives from the class.

  You can use the attribute to inform the resource manager where to find the default culture for an app: in the main assembly (default) or in a satellite assembly.

  Gets or sets the location from which to retrieve default fallback resources.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Globalization.CultureInfo `` To be added

  Returns culture-specific information for the main assembly's default resources by retrieving the value of the attribute on a specified assembly.

  The culture from the attribute, if found; otherwise, the invariant culture.

  The assembly for which to return culture-specific information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object ``

  The method is used to retrieve non-string resources. These include values that belong to primitive data types such as or , bitmaps (such as a object), or custom serialized objects. Typically, the returned object must be cast (in C#) or converted (in Visual Basic) to an object of the appropriate type.

  The returned resource is localized for the UI culture of the current thread, which is defined by the property. If the resource is not localized for that culture, the resource manager uses fallback rules to load an appropriate resource. If no usable set of localized resources is found, the falls back on the default culture's resources. If a resource set for the default culture is not found, the method throws a exception or, if the resource set is expected to reside in a satellite assembly, a exception. If the resource manager can load an appropriate resource set but cannot find a resource named , the method returns null.

  The property determines whether the comparison of with the names of resources is case-insensitive (the default) or case-sensitive.

  This method can throw more exceptions than are listed. One reason this might occur is if a method that this method calls throws an exception. For example, a exception might be thrown if an error was made deploying or installing a satellite assembly, or a exception might be thrown if a user-defined type throws a user-defined exception when the type is deserialized.

  ## Performance Considerations

  If you call the method multiple times with the same parameter, do not depend on the method returning a reference to the same object with each call. This is because the method can return a reference to an existing resource object in a cache, or it can reload the resource and return a reference to a new resource object.

  Returns the value of the specified non-string resource.

  The value of the resource localized for the caller's current culture settings. If an appropriate resource set exists but cannot be found, the method returns null.

  The name of the resource to get.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` ``

  The method is used to retrieve non-string resources. These include values that belong to primitive data types such as or , bitmaps (such as a object), or custom serialized objects. Typically, the returned object must be cast (in C#) or converted (in Visual Basic) to an object of the appropriate type.

  The returned resource is localized for the culture that is specified by , or for the culture that is specified by the property if is null. If the resource is not localized for that culture, the resource manager uses fallback rules to load an appropriate resource. If no usable set of localized resources is found, the resource manager falls back on the default culture's resources. If a resource set for the default culture is not found, the method throws a exception or, if the resource set is expected to reside in a satellite assembly, a exception. If the resource manager can load an appropriate resource set but cannot find a resource named , the method returns null.

  The property determines whether the comparison of with the names of resources is case-insensitive (the default) or case-sensitive.

  This method can throw more exceptions than are listed. One reason this might occur is if a method that this method calls throws an exception. For example, a exception might be thrown if an error was made deploying or installing a satellite assembly, or a exception might be thrown if a user-defined type throws a user-defined exception when the type is deserialized.

  ## Performance Considerations

  If you call the method multiple times with the same parameter, do not depend on the method returning a reference to the same object with each call. This is because the method can return a reference to an existing resource object in a cache, or it can reload the resource and return a reference to a new resource object.

  Gets the value of the specified non-string resource localized for the specified culture.

  The value of the resource, localized for the specified culture. If an appropriate resource set exists but cannot be found, the method returns null.

  The name of the resource to get. The culture for which the resource is localized. If the resource is not localized for this culture, the resource manager uses fallback rules to locate an appropriate resource.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  The method is useful only if you write your own class that derives from the class.

  This method uses the property as part of the file name for all cultures other than the invariant culture. This method does not look in an assembly's manifest or touch the disk, and is used only to construct a resource file name (suitable for passing to the constructor) or a manifest resource blob name.

  A derived class can override this method to look for a different extension, such as ".ResX", or a completely different scheme for naming resource files. Note that the method can be used to customize the name of a resource file within a satellite assembly, and not to customize the name of the satellite assembly itself.

  Generates the name of the resource file for the given object.

  The name that can be used for a resource file for the given object.

  The culture object for which a resource file name is constructed.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Resources.ResourceSet `` `` ``

  The resource set that is returned represents the resources that are localized for the specified culture. If the resources have not been localized for that culture and is true, uses resource fallback rules to load an appropriate resource. If is false and a culture-specific resource set cannot be found, the method returns null. For more information about resource fallback, see "The Resource Fallback Process" section in the Packaging and Deploying Resources article.

  Retrieves the resource set for a particular culture.

  The resource set for the specified culture.

  The culture whose resources are to be retrieved. true to load the resource set, if it has not been loaded yet; otherwise, false. true to use resource fallback to load an appropriate resource if the resource set cannot be found; false to bypass the resource fallback process. (See the Remarks section.)
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Version ``

  For more information about satellite assembly versioning, see the reference topic.

  Returns the version specified by the attribute in the given assembly.

  The satellite contract version of the given assembly, or null if no version was found.

  The assembly to check for the attribute.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.IO.UnmanagedMemoryStream ``

  The method takes the name of a resource that is stored as a object, gets the value of the resource, and returns an object. It requires that you work directly with a stream of bytes, which you then convert to an object. This method is useful primarily for performance reasons: Retrieving a resource as a byte stream instead of an explicit object can improve performance.

  The returned resource is localized for the UI culture of the current thread, which is defined by the property. If the resource is not localized for that culture, the resource manager uses fallback rules to load an appropriate resource. If no usable set of localized resources is found, the falls back on the default culture's resources. If a resource set for the default culture is not found, the method throws a exception or, if the resource set is expected to reside in a satellite assembly, a exception. If the resource manager can load an appropriate resource set but cannot find a resource named , the method returns null.

  The property determines whether the comparison of with the names of resources is case-insensitive (the default) or case-sensitive.

  Returns an unmanaged memory stream object from the specified resource.

  An unmanaged memory stream object that represents a resource .

  The name of a resource.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.IO.UnmanagedMemoryStream `` ``

  The method takes the name of a resource that is stored as a object, gets the value of the resource, and returns an object. It requires that you work directly with a stream of bytes, which you then convert to an object. This method is useful primarily for performance reasons: Retrieving a resource as a byte stream instead of an explicit object can improve performance.

  The returned resource is localized for the culture that is specified by , or for the culture that is specified by the property if is null. If the resource is not localized for that culture, the resource manager uses fallback rules to load an appropriate resource. If no usable set of localized resources is found, the falls back on the default culture's resources. If a resource set for the default culture is not found, the method throws a exception or, if the resource set is expected to reside in a satellite assembly, a exception. If the resource manager can load an appropriate resource set but cannot find a resource named , the method returns null.

  The property determines whether the comparison of with the names of resources is case-insensitive (the default) or case-sensitive.

  Returns an unmanaged memory stream object from the specified resource, using the specified culture.

  An unmanaged memory stream object that represents a resource.

  The name of a resource. An object that specifies the culture to use for the resource lookup. If is null, the culture for the current thread is used.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  ## Desktop Apps

  In desktop apps, the resource that is returned is localized for the UI culture of the current thread, as defined by the property. If the resource has not been localized for that culture, the resource manager probes for a resource by following the steps outlined in the "Resource Fallback Process" section of the Packaging and Deploying Resources article. If no usable set of localized resources is found, the resource manager falls back on the default culture's resources. If the resource manager cannot load the default culture's resource set, the method throws a exception or, if the resource set is expected to reside in a satellite assembly, a exception. If the resource manager can load an appropriate resource set but cannot find a resource named , the method returns null.

  The property determines whether the comparison of with the names of resources is case-insensitive (the default) or case-sensitive.

  This method can throw more exceptions than are listed. One reason this might occur is if a method that this method calls throws an exception. For example, a exception might be thrown if an error was made deploying or installing a satellite assembly, or a exception might be thrown if a user-defined type throws a user-defined exception when the type is deserialized.

  ## win8_appname_long Apps

  Although the class is supported in win8_appname_long apps, we do not recommend its use. Use this class only when you develop net_portable projects that can be used with win8_appname_long apps. To retrieve resources from win8_appname_long apps, use the Windows.ApplicationModel.Resources.ResourceLoader class instead.

  In win8_appname_long apps, the method returns the value of the string resource, localized for the caller's current UI culture settings. The list of cultures is derived from the operating system's preferred UI language list. If the resource manager cannot match , the method returns null.

  Returns the value of the specified string resource.

  The value of the resource localized for the caller's current UI culture, or null if cannot be found in a resource set.

  The name of the resource to retrieve.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  ## Desktop Apps

  In desktop apps, if is null, the method uses the current UI culture obtained from the property.

  The resource that is returned is localized for the culture specified by the parameter. If the resource has not been localized for , the resource manager probes for a resource by following the steps outlined in the "Resource Fallback Process" section of the Packaging and Deploying Resources topic. If no usable set of resources is found, the resource manager falls back on the default culture's resources. If the resource manager cannot load the default culture's resource set, the method throws a exception or, if the resource set is expected to reside in a satellite assembly, a exception. If the resource manager can load an appropriate resource set but cannot find a resource named , the method returns null.

  The property determines whether the comparison of with the names of resources is case-insensitive (the default) or case-sensitive.

  This method can throw more exceptions than are listed. One reason this might occur is if a method that this method calls throws an exception. For example, a exception might be thrown if an error was made deploying or installing a satellite assembly, or a exception might be thrown if a user-defined type throws a user-defined exception when the type is deserialized.

  ## win8_appname_long Apps

  Although the class is supported in win8_appname_long apps, we do not recommend its use. Use this class only when you develop net_portable projects that can be used with win8_appname_long apps. To retrieve resources from win8_appname_long apps, use the Windows.ApplicationModel.Resources.ResourceLoader class instead.

  In win8_appname_long apps, the method returns the value of the string resource, localized for the culture specified by the parameter. If the resource is not localized for the culture, the lookup uses the entire win8 language fallback list, and stops after looking in the default culture. If the resource manager cannot match , the method returns null.

  Returns the value of the string resource localized for the specified culture.

  The value of the resource localized for the specified culture, or null if cannot be found in a resource set.

  The name of the resource to retrieve. An object that represents the culture for which the resource is localized.
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 1 To be added

  Specifies the version of resource file headers that the current implementation of can interpret and produce.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool'

  If the value of the property is false, a resource with the name "Resource" is not equivalent to the resource with the name "resource". If is true, a resource with the name "Resource" is equivalent to the resource with the name "resource". Note, however, that when is true, the and methods perform case-insensitive string comparisons by using the invariant culture. The advantage is that results of case-insensitive string comparisons performed by these methods are the same on all computers regardless of culture. The disadvantage is that the results are not consistent with the casing rules of all cultures.

  For example, the Turkish alphabet has two versions of the character I: one with a dot and one without a dot. In Turkish, the character I (Unicode 0049) is considered the uppercase version of a different character ı (Unicode 0131). The character i (Unicode 0069) is considered the lowercase version of yet another character İ (Unicode 0130). According to these casing rules, a case-insensitive string comparison of the characters i (Unicode 0069) and I (Unicode 0049) should fail for the culture "tr-TR" (Turkish in Turkey). However, because the comparison is conducted by using the casing rules of the invariant culture if is true, this comparison succeeds.

  For performance reasons, it is best to always specify the correct case for your resource names. Setting to true can cause a significant increase in working set and a significant decline in performance.

  Gets or sets a value that indicates whether the resource manager allows case-insensitive resource lookups in the and methods.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Resources.ResourceSet `` `` `` To be added

  Provides the implementation for finding a resource set.

  The specified resource set.

  The culture object to look for. true to load the resource set, if it has not been loaded yet; otherwise, false. true to check parent objects if the resource set cannot be loaded; otherwise, false.
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 -1091581234

  The value is set to 0xBEEFCACE. The first four bytes of the system default file format contain a 32-bit signed integer in little-endian format (see ).

  If the is found, the bytes following it will be a version number for a header, followed by a number indicating how many bytes should be skipped to get past this header. The next number indicates the version of the that created the header, followed by version specific information.

  The version number for the current implementation is one. The next bytes are a length-prefixed string containing the name of an , which can read this file.

  Holds the number used to identify resource files.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Reflection.Assembly

  The field is useful only if you write your own class that derives from the class.

  Specifies the main assembly that contains the resources.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  This method will shrink the working set in a running app. Any future resource lookups on this 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 object is the appropriate behavior.

  Starting with the .NET Framework version 2.0, the method is not thread safe with respect to , , and operations. The advantage of this change is a performance improvement for multiple threads that access resources. However, if you call the method in one thread while simultaneously getting a resource in another thread, the get operation can throw an 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.

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

  Tells the resource manager to call the method on all objects and release all resources.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Obsolete("Use InternalGetResourceSet instead.")
  System.Collections.Hashtable To be added

  Contains a that returns a mapping from cultures to objects.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Type To be added: an object of type 'Type' To be added

  Gets the type of the resource set object that the resource manager uses to construct a object.