Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Resource manager problem: naming for embedded resource.

Reply
Thread Tools

Resource manager problem: naming for embedded resource.

 
 
Dirc Khan-Evans
Guest
Posts: n/a
 
      10-17-2005

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

--

 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      10-17-2005
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> 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
>
> --
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Javax.naming Exception: name not found in naming service. Harman Java 1 07-28-2006 08:51 AM



Advertisments