473,394 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ASP.NET 2.0 Resource Satellite Assemblies (Bug?)

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
3 1605
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Frank L | last post by:
Greetings, I am somewhat puzzled by a difference that occurs when I compile my web application out of VS.NET or if I compile it through NAnt. The issue is with how the resources get compiled into...
6
by: James | last post by:
I have two question regarding the version resource that is generated for a satellite assembly. 1) I have a file in my C# console app project called StringResources.en-US.resx. When I build the...
3
by: Sarah Woodfield | last post by:
Hi, I have written an application in VB.Net which runs well on my development PC. However on a few clients machines, at apparently random intervals, they get the above message and the programme...
3
by: Kelmen Wong | last post by:
I'm having a real hard-time to work out the hell of the statelite assembly. 1) At start, the official MSDN stated to use: .... new ResourceManager(strBaseName,...
0
by: Kleanthis | last post by:
I have a problem, when deploying multilingual applications using cab files on Compact Framework 2.0. It seems that something is going wrong with compact framework 2.0 Below I have a description...
1
by: scpedicini | last post by:
Let's say that I've built an assembly called MyApi.dll with two different language resource files, one called DefaultResource.resx (which is my english resource file), and a german resource file...
1
by: vecozo | last post by:
Centralized resource files Hi, We are considering to migrate our custom asp.net localization procedure, to one that stored .Text properties of controls in a SQL database, towards the usage of...
1
by: Jason | last post by:
Greetings , I'm studying for a MS exam and I'm a little confused about assemblies. Not what they are but just a specific comment that I'm reading and it doesn't make sense to me. It reads ...
0
by: Nader | last post by:
I'm trying to use satellite assemblies in my web application. I got a problem with loading resource files. I have the falowing code: protected ResourceManager GetStrings = new...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.