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

Resource manager problem: naming for embedded resource.


I am trying to localise my app using embedded resource
and sattellite assemblies.

I can get it working using the following if I have a resource
file with the same name as the class:

ResourceManager resourceManager =
new ResourceManager(this.GetType());

However, I want to use a global resource for my assembly.
I have tried using the following with a resource file called
Strings.resx:

ResourceManager resourceManager =
new ResourceManager("Strings", this.GetType().Assembly);

I have also messed around setting the Custom Tool Namespace
but cannot get this working either.

As far as I can tell I am following the documentation, but
I can't get this to work.... I know it's going to be a
simple answer.. so could someone please put me out of my misery!

I'm certain it's down to the naming convention used but I don't get it
from the documentation.
Thanks in advance

Dirc

--

Nov 19 '05 #1
1 1807
it should be NAMESPACE.Strings

so if the default namespace of your c# project is MyWebApp

it should be "MyWebApp.Strings"

to get the currently assembly, you should also do
System.Reflection.Assembly.GetExecutingAssembly

To find out the default namspace, right click on the project and goto
properties..it's in the first tab I think.

If you want a different (and better) way to deal with localized content,
check out:
http://openmymind.net/index.aspx?documentId=3
http://openmymind.net/index.aspx?documentId=4

and there's a part 3 coming soon :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Dirc Khan-Evans" <di*************@eurorscgskybridge.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...

I am trying to localise my app using embedded resource
and sattellite assemblies.

I can get it working using the following if I have a resource
file with the same name as the class:

ResourceManager resourceManager =
new ResourceManager(this.GetType());

However, I want to use a global resource for my assembly.
I have tried using the following with a resource file called
Strings.resx:

ResourceManager resourceManager =
new ResourceManager("Strings", this.GetType().Assembly);

I have also messed around setting the Custom Tool Namespace
but cannot get this working either.

As far as I can tell I am following the documentation, but
I can't get this to work.... I know it's going to be a
simple answer.. so could someone please put me out of my misery!

I'm certain it's down to the naming convention used but I don't get it
from the documentation.
Thanks in advance

Dirc

--

Nov 19 '05 #2

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

Similar topics

5
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
1
by: Bruce | last post by:
I would like to store a text file as an embedded resource, and then at runtime read it in as if it were a text file on the hard drive. Is this possible? --Bruce
1
by: richlm | last post by:
If I embed a resource with filename "test_cs.xslt" in my c# project, Assembly.GetExecutingAssembly.GetManifestResourceNames works as expected. If I change the filename to "test.cs.xslt" I get 0...
2
by: Fredrik Rodin | last post by:
All, I'm having problems with my resource manager in ASP.NET 2.0 after conversion from ASP.NET 1.1. Here is a background: In ASP.NET 1.1 All my user controls and aspx pages inherit from...
4
by: Jason Pettys | last post by:
In an ASP.NET project I am setting the content type of my .ascx and ..aspx files to Embedded Resource for a separate reason. When I do this they get embedded as "RootNamespace.Filename" but I...
0
by: Miguel Dias Moura | last post by:
Hello, I know that in Asp.Net 2.0 the file MyResources.resx is for en-US and is the base file. For example, MyResources.fr-FR.resx is for french culture. My questions are: 1. How to I set...
9
by: Alf P. Steinbach | last post by:
<what to design a C++ solution for> A Windows API /resource/ is data embedded in the executable, accessed via API functions. A resource is completely identified by the quadruple (id, type,...
1
by: Bill Mell | last post by:
I would like to use compiled resource files in my web application that are not related to localization. The idea is to have a dll with resources that can be accessed by the website. I have no...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?

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.