summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTarek Mahmoud Sayed <tarekms@microsoft.com>2017-06-29 12:32:30 -0700
committerGitHub <noreply@github.com>2017-06-29 12:32:30 -0700
commit88e0428caa33fd04bd8f5f8bc1a60b6a44b93622 (patch)
treee8d1ba1f595c9d4ebb3e2f6d4b2e5cb22d926a01 /src
parent07258b7ac54cef46ef143b450d6e607fd4a017db (diff)
downloadcoreclr-88e0428caa33fd04bd8f5f8bc1a60b6a44b93622.tar.gz
coreclr-88e0428caa33fd04bd8f5f8bc1a60b6a44b93622.tar.bz2
coreclr-88e0428caa33fd04bd8f5f8bc1a60b6a44b93622.zip
Make ResourceManager netstandard 2.0 API behave correctly (#12536)
* Make ResourceManager netstandard 2.0 API behave correctly In netstandard 2.0 we have enabled the APIs like GetObject, GetStream,..etc. these are not functioning correctly in UWP apps because was assuming we always uses PRI files. The changes here is to initialize the managed resources too and let these APIs behave as if we are running inside desktop app. * added #ifdef * Remove the throwing as PRI can handle case insenitive lookup * remove un-needed resources
Diffstat (limited to 'src')
-rw-r--r--src/mscorlib/src/System/Resources/ResourceManager.cs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mscorlib/src/System/Resources/ResourceManager.cs b/src/mscorlib/src/System/Resources/ResourceManager.cs
index 994aa8ce25..92b935d931 100644
--- a/src/mscorlib/src/System/Resources/ResourceManager.cs
+++ b/src/mscorlib/src/System/Resources/ResourceManager.cs
@@ -438,18 +438,16 @@ namespace System.Resources
// security check in each constructor prevents it.
private void CommonAssemblyInit()
{
- if (_bUsingModernResourceManagement == false)
- {
- UseManifest = true;
+ // Now we can use the managed resources even when using PRI's to support the APIs GetObject, GetStream...etc.
+ UseManifest = true;
- _resourceSets = new Dictionary<String, ResourceSet>();
- _lastUsedResourceCache = new CultureNameResourceSetPair();
+ _resourceSets = new Dictionary<String, ResourceSet>();
+ _lastUsedResourceCache = new CultureNameResourceSetPair();
- _fallbackLoc = UltimateResourceFallbackLocation.MainAssembly;
+ _fallbackLoc = UltimateResourceFallbackLocation.MainAssembly;
- ResourceManagerMediator mediator = new ResourceManagerMediator(this);
- resourceGroveler = new ManifestBasedResourceGroveler(mediator);
- }
+ ResourceManagerMediator mediator = new ResourceManagerMediator(this);
+ resourceGroveler = new ManifestBasedResourceGroveler(mediator);
_neutralResourcesCulture = ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(MainAssembly, ref _fallbackLoc);
}