Bug 14987 - localized resource loading is overoptimized
Summary: localized resource loading is overoptimized
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-09-25 11:49 UTC by Stephen McConnel
Modified: 2014-03-17 10:52 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

sample program that exposes bug in loading localized resources (36.93 KB, application/zip)
2013-09-25 11:49 UTC, Stephen McConnel

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 14987 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Stephen McConnel 2013-09-25 11:49:58 UTC
Created attachment 4990 [details]
sample program that exposes bug in loading localized resources

In System.Resources.ResourceManager, the use of the static NonExistent Hashtable can prevent existing localized resources from being loaded.  If a nonlocalized resource is loaded, then subsequent attempts to load localized resources will always fail.  I'm attaching a simple program that exposes this bug.  The program works fine on VS2010, so I consider this a real bug in Mono.  :-(

The simplest fix would be to make the NonExistent Hashtable a member variable instead of static.  This loses most of the desired optimization when the culture truly has no localized resources, but still saves some time.
Comment 1 eb1 2014-03-14 13:06:17 UTC
Suggested fix in PR #956.
Comment 2 eb1 2014-03-17 10:52:56 UTC
Merged into master