I have recently migrated an ASP.NET 1.1 web application to ASP.NET 2.0.
In this application I am storing all my resources in satellite
assemblies and I am accessing them via the ResourceManager object.
However, the ResourceManager is no longer returning the resources from
the satellite assemblies; it appears that it is always using the
fallback resource assembly (neutral); which in my case is the resource
assembly that is embedded in the main assembly.
The odd thing is that when I view the ResourceManager in the watch
window, I can see that it has found my satellite assesmblies (French
Canadian - fr-CA) and I can access the satellite assembly via
GetSatelliteAssembly() method of the executing assembly.
- ResourceSets Count = 3 System.Collections.Hashtable
+ [{}] {System.Resources.RuntimeResourceSet}
+ [{fr-CA}] {System.Resources.RuntimeResourceSet}
+ [{fr}] {System.Resources.RuntimeResourceSet}
+ Raw View
As, well, I can get the satellite assembly via the
GetSatelliteAssembly() method. I don't want to use this method because
it doesn't incorporate the fallback mechanism:
ResourceManager rm = new ResourceManager("Namespace.ResourceFileName",
Assembly.GetExecutingAssembly().GetSatelliteAssemb ly(new
CultureInfo("fr-CA")));
string test = rm.GetString("StringKey");
However, I cannot access the satellite assembly by doing the following:
ResourceManager rm = new ResourceManager("Namespace.ResourceFileName",
Assembly.GetExecutingAssembly());
string test = rm.GetString("StringKey", new CultureInfo("fr-CA") );
Is this a bug is 2.0? Does anyone have a solution for this? I would
still like to use satellite assemblies and not the new Local and Global
resource feature in 2.0.
Thanks in advance for your help, it is much appreciated
Garry