473,770 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

loading the right resources with Satellite Assemblies

I have the next simple code and it doesn't work:
ResourceManager gStrings = new ResourceManager ("MyApp.Strings ",
Assembly.GetExe cutingAssembly( ));

//Get the user's language.
CultureInfo ci = new CultureInfo("es ");
String str = gStrings.GetStr ing("Username", ci);

I have two assemblies: one is the fallback String.resx and the other
one is Strings.es.resx
The problem is that str is getting it's string from the fallback and
it just doesn't want to get it from es-assembly
What am I doing wrong??

I would be greatfull if someone helps!

Mar 14 '07 #1
1 1832
I once had a bizarre situation similar to this where I was banging my head
against a wall for ages - it worked for all classes in the system except
one. I tracked it down to a situation where I had an enum defined in the
same source file as the class using the resource manager - as soon as I took
that enum definition out of the same source file it worked. The presence of
the enum class was causing the compiler to generate an incorrect name for
the resource in the satellite assembly (but was correct in the main
assembly, so that fallback worked OK).

1) Where are you deploying your Strings.es.dll assembly? Is it in a
subdirectory called "es" under the directory containing the main assembly?
2) What does the name of the localised resource come out as in the satellite
assembly? (Open up your satellite Strings.es.dll assembly in ildasm.exe,
open up the Manifest section and look at the resource listings of the form
(for example) .mresource public 'Strings.es.res ources')
"Nader" <na**********@g mail.comwrote in message
news:11******** **************@ y80g2000hsf.goo glegroups.com.. .
>I have the next simple code and it doesn't work:
ResourceManager gStrings = new ResourceManager ("MyApp.Strings ",
Assembly.GetExe cutingAssembly( ));

//Get the user's language.
CultureInfo ci = new CultureInfo("es ");
String str = gStrings.GetStr ing("Username", ci);

I have two assemblies: one is the fallback String.resx and the other
one is Strings.es.resx
The problem is that str is getting it's string from the fallback and
it just doesn't want to get it from es-assembly
What am I doing wrong??

I would be greatfull if someone helps!

Mar 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7572
by: Nils Erik Asmundvaag | last post by:
Hello I hope someone is able to help me with this frustrating problem. I have a C# web project in Visual Studio .NET 2003. I want to support Swedish and Norwegian texts and have put the texts in resource files (.resx). I build the project from the IDE without errors. A main assembly (containing the Swedish texts) are created, and a resource assembly
0
1543
by: BillKi | last post by:
I am working on localizing my webservice to return localized error messages to our client app. I have created 3 resx files, 1 for english (default), 1 for spanish, and 1 for italian. When I build my project the default english gets built into my webservice dll and the other two are built into their own dlls in the appropriate folders under bin\es-ES and bin\it-IT. All is well.
2
1589
by: mathieu | last post by:
Hi, I was wondering what is the best way to include resource in library. I saw an example with a library which only contained one class (Person) and the resources file associated with it (Person.resx and Person.en.resx). But what if my library contains 50 classes ?? Is there a way to put all resources for a library in one file per language? If so how can it be done, what is the name of the resource file. thanks mathieu
4
2144
by: Phil Da Lick! | last post by:
Hello, Got strings.resx included in my assmebly as the default language neutral collection. ResourceManager res=new ResourceManager("strings", Assembly.GetExecutingAssembly()); string test=res.GetString("TestString");
2
7280
by: franzhe | last post by:
Hi all, in a simple ASP.Net application with resources in satellite assemblies I have the following problem: If I set <identity impersonate="true"/>, accessing a culture specific resource from a satellite assembly fails with the error message: "Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. ..."
0
9169
by: Rob Dob | last post by:
Hi, I have a VS2003 C# asp.net project that has been converted into a VS2005 project. Everything seemed to work well until I make a modification to anything within the Component Designer window, i.e. I add a SQLCommand. At that point VS2005 changes my C# file to now load all Selectcommantext data from the resource file instead of the .aspx.cs file. then when I try and once again run my application I get the following error: looking...
0
2317
by: npthomson | last post by:
Hi all, This could get a bit complicated but I'll try to be as clear as possible. I've written an application that discovers plugins at runtime using reflection from a subdirectory of the application, eg: In the directory the application is installed to: \application.exe \plugins\plugin1.dll
0
1046
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 ResourceManager("StringsFallback", typeof(Satellite).Assembly); This should load the resources stored in the StringsFallback assembly file. Actually I don't realy know what exactly I should put at the second argument... And I get this error message:
1
1371
by: rizwanahmed24 | last post by:
Hi i have project (say project A) that contains extra resource files for different languages. i m using the assembly of this project in to another project (say project B). the assembly of project A contains the default resource files but doesnt contain resource files for other languages. I place the assembly of project A into plugins folder of project B so that i can load the assembly from there. where should i place the assemby...
0
9618
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.