how to use resx files in a class library

hi

plz guide me on how to use globalization in class libraries

i am able apply globalization in web page..but when tried with clas library it is giving error as missingmanifest

the steps which i followed is

1)create one class library

2)add 2 class files

3)add 3 resource file

ExResource.de-DE.resx

ExResource.en-US.resx

ExResource..resx

then in one of the class file

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

CultureInfo ci = Thread.CurrentThread.CurrentCulture;

string strWhatHappened = rm.GetString("WhatHappened", ci);(this one is throwing exception missing manifest)

plz help...

i

[757 byte] By [Reshma] at [2008-1-10]
# 1
Project + Properties, Application tab, what is "Default namespace" set to? Run Ildasm.exe on your compiled assembly, double-click Manifest, what's the name of your .mresource?
nobugz at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2

Hi

Thanks for ur immediate reponse

Default namespace is name of my classlibrary project- CExceptionHandler1

my manifest info

.mresource public CExceptionHandler1.ExResource.resources
{
// Offset: 0x00000000 Length: 0x00000571
}
.module CExceptionHandler1.dll
// MVID: {D58C42B8-F498-49CA-B35F-C186DD9385B1}
.imagebase 0x00400000
.file alignment 0x00001000
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x038C0000

Reshma at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 3
Try this:

ResourceManager rm = new ResourceManager("CExceptionHandler1.ExResource.resources", Assembly.GetExecutingAssembly());

nobugz at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 4

Hi

Tried with ResourceManager rm = new ResourceManager("CExceptionHandler1.ExResource.resources", Assembly.GetExecutingAssembly());

but exception is same

missingmanifestresource exception

error detail

"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure \"CExceptionHandler1.ExResource.resources.resources\" was correctly embedded or linked into assembly \"CExceptionHandler1\" at compile time, or that all the satellite assemblies required are loadable and fully signed."}

stack trace

at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at CExceptionHandler1.ExHandler002.ExceptionToPage() in C:\Documents and Settings\rekha\My Documents\Visual Studio 2005\Projects\CExceptionHandler1\ExHandler002.cs:line 94
at CExceptionHandler1.ExHandler002.HandleException(Exception ex, HttpApplication app) in C:\Documents and Settings\rekha\My Documents\Visual Studio 2005\Projects\CExceptionHandler1\ExHandler002.cs:line 75
at CExceptionHandler1.ExModule001.Application_Error(Object source, EventArgs e) in C:\Documents and Settings\rekha\My Documents\Visual Studio 2005\Projects\CExceptionHandler1\ExModule001.cs:line 56
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.HttpApplication.RaiseOnError()

regards

rekha

Reshma at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 5
Note that you got "resources" twice in the error message. Drop it from the constructor argument.
nobugz at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 6

hi nobugz..

thank u very much for ur timely help

i have got it right

ResourceManager rm = new ResourceManager("CExceptionHandler1.ExResource", Assembly.GetExecutingAssembly());

Regards

reshma

Reshma at 2007-10-3 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified