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

using satellite assemblies, loading resource files

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:
The type or namespace name 'Satellite' could not be found (are you
missing a using dir....)

Can anyone help please?

Mar 13 '07 #1
2 2382
Nader,

According to this:
ResourceManager GetStrings = new ResourceManager("StringsFallback",
typeof(Satellite).Assembly);
You are looking for something called StringsFallback.Resources in the same
assembly where the Satellite class lives.

There needs to be:
1. a class named "Satellite" in the assembly your after
2. the calling assembly, where the code snippet above lives, should have a
reference to the assmebly where the "Satellite" class lives
Dave
Mar 15 '07 #2
Nader,

You can also access a resource file using the following:

Here is an example of loading a resource file called MyResource.resx from a
satellite assembly called ClassLibrary. The namespace that the resource is
in is called ClassLibraryNS:

Assembly satAssembly = Assembly.Load("ClassLibrary");
ResourceManager rm = new ResourceManager("ClassLibraryNS.MyResource",
satAssembly);
string s = rm.GetString("String1");
MessageBox.Show(this, s);

See also:
http://www.sliver.com/dotnet/articles/resinweb.aspx
Dave
Mar 15 '07 #3

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

Similar topics

0
by: Ben Jones | last post by:
Hi there, I am looking into the ease of implementing the localization/globalization features of .NET using C#. I have a test app which creates a ResourceManager and attempts to load a resource...
1
by: Cindy | last post by:
I'm trying to create a satellite assembly for my winform project but the resource.dll that gets created with the assembly linker (al.exe) doesn't get used when the language is specified. However,...
8
by: nbaiju | last post by:
Hi, I am building a asp.net application which has satellite assemblies. When building the satellite assemblies dll's from Visual Studio 2003 GUI the application works fine . i.e. the resource...
1
by: Afaq | last post by:
Hi, After adding large number of empty resource files (which will be updated later), we are not able to compile the project. the following is the output of the build process. It fails while...
1
by: Martin Platt | last post by:
Guys! I've been playing about with some code trying to get the satellite assembly resource files to work. From what I understand you must have a fallback for a particular language, as well as...
3
by: BBC1009 | last post by:
Don't know why when rebuild VB.Net project (vb.net 2002 framework 1.0), this error comes out suddenly. Anyone can help. Thanks!!!!
3
by: Adam Calderon | last post by:
In ASP.NET 2.0 you have the choice of using the built in App_GlobalResoruces or App_LocalResources style of using resources or you can use your own resources utilizing satellite assemblies. In the...
3
by: gjenglish | last post by:
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...
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: Michel | last post by:
Hi! I have a question to loading resource-files to my application during runtime. Is it possible to get all languages for which a satellite assembly exist during runtime? I want to show a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...

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.