UltimateResourceFallbackLocation 枚举


指定 ResourceManager 对象是否在主程序集或在附属程序集中查找应用的默认区域性的资源。Specifies whether a ResourceManager object looks for the resources of the app's default culture in the main assembly or in a satellite assembly.

public enum class UltimateResourceFallbackLocation
public enum UltimateResourceFallbackLocation
type UltimateResourceFallbackLocation = 
Public Enum UltimateResourceFallbackLocation


MainAssembly 0

回退资源位于主程序集中。Fallback resources are located in the main assembly.

Satellite 1

回退资源位于附属程序集中。Fallback resources are located in a satellite assembly.


UltimateResourceFallbackLocation枚举与ResourceManager构造函数一起使用, 以指定对象是从主应用程序集 (默认设置) 还是从附属程序集检索应用的默认区域性的资源。 NeutralResourcesLanguageAttribute.NeutralResourcesLanguageAttribute(String, UltimateResourceFallbackLocation)The UltimateResourceFallbackLocation enumeration is used with the NeutralResourcesLanguageAttribute.NeutralResourcesLanguageAttribute(String, UltimateResourceFallbackLocation) constructor to specify whether a ResourceManager object retrieves the resources of the app's default culture from the main app assembly (the default), or from a satellite assembly. 在本地化的应用程序中, 如果在使用资源回退进程后找不到区域性特定的资源, 则使用默认区域性的资源。In a localized application, the resources of the default culture are used if no culture-specific resources are found after using the resource fallback process. 有关详细信息,请参阅 Packaging and Deploying Resources中的“资源回退进程”一节。For more information, see the "Resource Fallback Process" section in Packaging and Deploying Resources.

如果为NeutralResourcesLanguageAttribute属性指定值 MainAssembly 或无值, 并且 resource manager 无法加载属于默认区域性的资源集, 则会MissingManifestResourceException引发异常。If you specify a value of MainAssembly or no value to the NeutralResourcesLanguageAttribute attribute and resource manager cannot load a resource set that belongs to the default culture, it throws a MissingManifestResourceException exception. 如果你将的值指定为 "附属NeutralResourcesLanguageAttribute项", 并且 "资源管理器" 无法加载属于默认区域性的资源集, MissingSatelliteAssemblyException则会引发异常。If you specify a value of Satellite to the NeutralResourcesLanguageAttribute and resource manager cannot load a resource set that belongs to the default culture, it throws a MissingSatelliteAssemblyException exception.