By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,220 Members | 1,473 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,220 IT Pros & Developers. It's quick & easy.

ASP.NET 2.0 Resource Satellite Assemblies (Bug?)

P: n/a
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

Dec 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
gjenglish wrote:
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.


Does it work if you replace GetString with GetLocalResourceObject?

--
Jim Cheshire
================================
Blog: http://blogs.msdn.com/jamesche

Dec 20 '05 #2

P: n/a
Thank you Jim for your reply.

GetLocalResourceObject method gets a page level resource. These
resources are located in the App_LocalResources folder in an ASP.NET
application.

I am having a problem with resource satellite assemblies, which are not
stored in the App_LocalResources folder. Please let me know if my
previous posting isn't clear enough.

Thanks,

Garry

Dec 20 '05 #3

P: n/a
I have found a work around for this issue.

Instead of including the .resource files to the class library project,
I included the .resx files. VS.NET will still compile the .resx to the
binary .resource file and build the satellite assemblies.

It appears that VS.NET can't build satellite assemblies from .resource
files any more. Is this a bug?

Dec 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.