From ca08a38bcab9bdc87eaa129e5960e4169442f72c Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Fri, 26 Oct 2018 22:57:42 -0400 Subject: [PATCH] Remove dead RESOURCE_SATELLITE_CONFIG (#20639) --- .../System.Private.CoreLib.csproj | 2 +- .../Resources/ManifestBasedResourceGroveler.cs | 7 --- .../src/System/Resources/ResourceManager.cs | 55 ---------------------- 3 files changed, 1 insertion(+), 63 deletions(-) diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj index a6a321d..b3ca6ce 100644 --- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -30,7 +30,7 @@ false true true - $(DefineConstants);CORECLR;_USE_NLS_PLUS_TABLE;RESOURCE_SATELLITE_CONFIG;CODE_ANALYSIS_BASELINE;netcoreapp + $(DefineConstants);CORECLR;_USE_NLS_PLUS_TABLE;CODE_ANALYSIS_BASELINE;netcoreapp <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)/Documentation diff --git a/src/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs b/src/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs index 22d5445..ba1f2a8 100644 --- a/src/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs +++ b/src/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs @@ -69,13 +69,6 @@ namespace System.Resources // don't bother looking in satellites in this case satellite = _mediator.MainAssembly; } -#if RESOURCE_SATELLITE_CONFIG - // If our config file says the satellite isn't here, don't ask for it. - else if (!lookForCulture.HasInvariantCultureName && !_mediator.TryLookingForSatellite(lookForCulture)) - { - satellite = null; - } -#endif else { satellite = GetSatelliteAssembly(lookForCulture, ref stackMark); diff --git a/src/System.Private.CoreLib/src/System/Resources/ResourceManager.cs b/src/System.Private.CoreLib/src/System/Resources/ResourceManager.cs index 6bb4af2..6c7f6e7 100644 --- a/src/System.Private.CoreLib/src/System/Resources/ResourceManager.cs +++ b/src/System.Private.CoreLib/src/System/Resources/ResourceManager.cs @@ -141,13 +141,6 @@ namespace System.Resources private bool UseManifest; // Use Assembly manifest, or grovel disk. -#if RESOURCE_SATELLITE_CONFIG - private static volatile Hashtable _installedSatelliteInfo; // Give the user the option - // to prevent certain satellite assembly probes via a config file. - // Note that config files are per-appdomain, not per-assembly nor process - private static volatile bool _checkedConfigFile; // Did we read the app's config file? -#endif - // Whether to fall back to the main assembly or a particular // satellite for the neutral resources. private UltimateResourceFallbackLocation _fallbackLoc; @@ -1137,45 +1130,6 @@ namespace System.Resources return ums; } -#if RESOURCE_SATELLITE_CONFIG - // Internal helper method - gives an end user the ability to prevent - // satellite assembly probes for certain cultures via a config file. - private bool TryLookingForSatellite(CultureInfo lookForCulture) - { - if (!_checkedConfigFile) - { - lock (this) - { - if (!_checkedConfigFile) - { - _checkedConfigFile = true; - _installedSatelliteInfo = GetSatelliteAssembliesFromConfig(); - } - } - } - - if (_installedSatelliteInfo == null) - return true; - - string[] installedSatellites = (string[])_installedSatelliteInfo[MainAssembly.FullName]; - - if (installedSatellites == null) - return true; - - // The config file told us what satellites might be installed. - int pos = Array.IndexOf(installedSatellites, lookForCulture.Name); - - return pos >= 0; - } - - // Note: There is one config file per appdomain. This is not - // per-process nor per-assembly. - private Hashtable GetSatelliteAssembliesFromConfig() - { - return null; - } -#endif // RESOURCE_SATELLITE_CONFIG - internal class ResourceManagerMediator { private ResourceManager _rm; @@ -1262,15 +1216,6 @@ namespace System.Resources { get { return _rm.BaseName; } } - - -#if RESOURCE_SATELLITE_CONFIG - internal bool TryLookingForSatellite(CultureInfo lookForCulture) - { - return _rm.TryLookingForSatellite(lookForCulture); - } -#endif - } } } -- 2.7.4