System.Resources.NeutralResourcesLanguageAttribute Class

Informs the resource manager of an app's default culture. This class cannot be inherited.

See Also: NeutralResourcesLanguageAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Assembly)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class NeutralResourcesLanguageAttribute : Attribute

Remarks

Desktop Apps

In desktop apps, the System.Resources.NeutralResourcesLanguageAttribute attribute informs the resource manager of an app's default culture and the location of its resources. By default, resources are embedded in the main app assembly, and you can use the attribute as follows. This statement specifies that the English (United States) is the app's default culture.

code reference: System.Resources.NeutralResourcesLanguageAttribute#1

You can also use the System.Resources.NeutralResourcesLanguageAttribute attribute to indicate where System.Resources.ResourceManager can find the resources of the default culture by providing an System.Resources.UltimateResourceFallbackLocation enumeration value in the attribute statement. This is most commonly done to indicate that the resources reside in a satellite assembly. For example, the following statement specifies that English (United States) is the app's default or neutral culture and that its resources reside in a satellite assembly. The System.Resources.ResourceManager object will look for them in a subdirectory named en-US.

code reference: System.Resources.NeutralResourcesLanguageAttribute#2

Note:

We recommend that you always use the System.Resources.NeutralResourcesLanguageAttribute attribute to define the default culture of your app.

The attribute performs two roles:

win8_appname_long Apps

In win8_appname_long apps whose resources are loaded and retrieved by using the System.Resources.ResourceManager class, the System.Resources.NeutralResourcesLanguageAttribute attribute defines the neutral culture whose resources are used in the event of a failed probe. It does not specify the location of the resources. By default, System.Resources.ResourceManager uses the app's package resource index (PRI) file to locate the resources of the default culture. The neutral culture that is defined by the System.Resources.NeutralResourcesLanguageAttribute attribute is added to the end of the UI language list to simulate this effect.

If you load and retrieve resources by using the wrt tp://go.microsoft.com/fwlink/p/?LinkId=238182 class or the types in the tp://go.microsoft.com/fwlink/p/?LinkId=238194 namespace, the System.Resources.NeutralResourcesLanguageAttribute attribute is ignored.

Requirements

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