From fa3d1cdd5583d5b278dd1a9c246ff30ca6966973 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Thu, 20 Jul 2017 16:36:15 -0700 Subject: Fix resources lookup to use satellite assembly resouce lookup inside AppX when the assembly is Private.Corelib (#12954) --- src/mscorlib/src/System/Resources/ResourceManager.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mscorlib/src/System/Resources/ResourceManager.cs b/src/mscorlib/src/System/Resources/ResourceManager.cs index 92b935d931..f171239857 100644 --- a/src/mscorlib/src/System/Resources/ResourceManager.cs +++ b/src/mscorlib/src/System/Resources/ResourceManager.cs @@ -889,7 +889,7 @@ namespace System.Resources // contains the PRI resources. private bool ShouldUseSatelliteAssemblyResourceLookupUnderAppX(RuntimeAssembly resourcesAssembly) { - bool fUseSatelliteAssemblyResourceLookupUnderAppX = true; // TODO: https://github.com/dotnet/coreclr/issues/12178 once we fix our uap testhost + bool fUseSatelliteAssemblyResourceLookupUnderAppX = typeof(Object).Assembly == resourcesAssembly; if (!fUseSatelliteAssemblyResourceLookupUnderAppX) { @@ -1038,6 +1038,11 @@ namespace System.Resources if (e.HResult != __HResults.ERROR_MRM_MAP_NOT_FOUND) throw; // Unexpected exception code. Bubble it up to the caller. } + + if (!_PRIonAppXInitialized) + { + _bUsingModernResourceManagement = false; + } // Allow all other exception types to bubble up to the caller. // Yes, this causes us to potentially throw exception types that are not documented. @@ -1122,7 +1127,7 @@ namespace System.Resources { // When running inside AppX we want to ignore the languages list when trying to come up with our CurrentUICulture. // This line behaves the same way as CultureInfo.CurrentUICulture would have in .NET 4 - culture = CultureInfo.GetCurrentUICultureNoAppX(); + culture = CultureInfo.CurrentUICulture; } ResourceSet last = GetFirstResourceSet(culture); -- cgit v1.2.3