473,395 Members | 1,675 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,395 software developers and data experts.

ResourceManager is unable to load resources in satellite assemblies

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
containg the Norwegian texts are created in a subdirectory called no.

When I run the project, the ResourceManager is not able to get my
Norwegian texts from the satellite assembly. I have started the
project in debug mode, and I can see that the CurrentUICulture and
CurrentCulture is set to "Norwegian".

I have read the tutorials from Microsoft and other articles on the
net, but I haven't found any help.

N E Asmundvaag
Jul 21 '05 #1
3 7499
Nils,

Your approach is correct in principle. I suspect there may be a problem with
the resource manager object, but it's impossible to tell without looking at
the code. Did you make sure to pass the name of the base resource file along
with the namespace reference to your ResourceManager constructor? This is
one of the most common mistakes. For example, if you were using the
namespace 'MyApp' and your main resource file (the one to be embedded in the
main assembly) were called 'AppStrings.resx', the constructor would look
something like this:

ResourceManager rm = new ResourceManager("MyApp.AppStrings",
Assembly.GetExecutingAssembly());

or if you are instantiating the resource manager on a web form called
WebForm1 which is part of your main assembly:

ResourceManager rm = new ResourceManager("MyApp.AppStrings",
typeof(WebForm1).Assembly);

After that, a simple call to

rm.GetString("<ResourceID>");

should do the trick and retrieve the appropriate resource from a satellite
assembly who's culture matches the CurrentUICulture.

Another common problem is related to the naming conventions required for the
RESX files themselves. The base resource file should not contain a specific
culture (e.g. AppStrings.resx), but the RESX files that go into your
satellite assemblies *must* contain the culture in their file names. So in
this example, your Norwegion resources would have to be named
AppStrings.no.resx. If you need more specific cultures, both
AppStrings.nn-NO.resx and AppStrings.nb-NO.resx would also be correct.
However, since you mention that a NO directory is created when you compile,
it sounds like your RESX file is probably named correctly already.

That's really all you should have to do. I'm sorry if I'm not telling you
anything new, but it's the best I can do without looking at your code.

--
Kai Brinkmann [MSFT]

Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Nils Erik Asmundvaag" <ne*@orgconsult.no> wrote in message
news:e1**************************@posting.google.c om...
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
containg the Norwegian texts are created in a subdirectory called no.

When I run the project, the ResourceManager is not able to get my
Norwegian texts from the satellite assembly. I have started the
project in debug mode, and I can see that the CurrentUICulture and
CurrentCulture is set to "Norwegian".

I have read the tutorials from Microsoft and other articles on the
net, but I haven't found any help.

N E Asmundvaag

Jul 21 '05 #2
Hi,

I had the same problem with one of my apps and finally came with an
workaround (I'm not sure this is actually the 'official' thing to do, but it
solved my problem): give IUSR_<machine> full rights on the temporary ASP.NET
files (that is %SYSTEM%\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files). For whatever reason, at some point asp.net worker process tries to
create some folders there and it fails (from my observations, this is
related to the point when the resources come in the scene).

Cosmin

"Nils Erik Asmundvaag" <ne*@orgconsult.no> wrote in message
news:e1**************************@posting.google.c om...
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
containg the Norwegian texts are created in a subdirectory called no.

When I run the project, the ResourceManager is not able to get my
Norwegian texts from the satellite assembly. I have started the
project in debug mode, and I can see that the CurrentUICulture and
CurrentCulture is set to "Norwegian".

I have read the tutorials from Microsoft and other articles on the
net, but I haven't found any help.

N E Asmundvaag

Jul 21 '05 #3
"Cosmin Marin" <no****@nospam.ro> wrote in message news:<#3**************@TK2MSFTNGP11.phx.gbl>...
Hi,

I had the same problem with one of my apps and finally came with an
workaround (I'm not sure this is actually the 'official' thing to do, but it
solved my problem): give IUSR_<machine> full rights on the temporary ASP.NET
files (that is %SYSTEM%\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files). For whatever reason, at some point asp.net worker process tries to
create some folders there and it fails (from my observations, this is
related to the point when the resources come in the scene).

Cosmin


Hello Cosmin,

This solved my problem. Thank you very much for the help!

Nils Erik
Jul 21 '05 #4

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

Similar topics

5
by: Rudolf Ball | last post by:
Dear NG, i want to load a plugin (WinForm) in my Applikation. That works fine. Now I want to globalize that plugin. So I have to load the Satellite Assembly, as well. But how can I load this...
2
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...
1
by: Abubakar | last post by:
Hi everyone, Lets suppose I'v a class lib mylib.dll which is about 3mb in size. Now if I refernce it from a windows forms app which uses mylib.dll, will all the 3mb be loaded into memory as soon as...
2
by: FireStarter | last post by:
I entered a couple of strings in the project's resource file (Resources.resx). At execution time, I want to retrieve one of them: ResourceManager rm = new ResourceManager(<baseName>,...
1
by: Weenie the Pooh | last post by:
We are writing an ASP.Net C# application (VS 2003) and plan to use embedded resources files for french, german and english UI. I created resx files named _todo.resx and _todo.fr-CH.resx Here...
2
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...
3
by: Maileen | last post by:
Hi, I've created an assembly where are stores some strings. By using menu items, user can change language of application GUI (so using the strings in my assemblies) 1. how can i compile my...
3
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...
1
by: nelsonbrodyk | last post by:
Hey All, Here is some background of what I want to do. The problem is, I don't know if it's even possible. I want to have default translation file, built into the source code, via .resx files. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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.