tags:

views:

60

answers:

1

Hi,

I have problem to make work a resource file. This is my simple code : ResourceManager rm = new ResourceManager("RessourceFile", Assembly.GetExecutingAssembly());

string header = rm.GetString("EmailHeader");

And this is the error : MissingManifestResourceFileException Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "RessourceFile.resources" was correctly embedded or linked into assembly "Mailer" at compile time, or that all the satellite assemblies required are loadable and fully signed.

I have created in the project a file called RessourceFile.resx

Thank you for your help.

+1  A: 

Make sure you specify the full name for your resource file. If you created the file within a project with the default namespace "MyApplication", then the full name of your resource file is likely "MyApplication.RessourceFile". This is what you want to pass to the ResourceManager constructor.

Check your resource designer file to verify the full name.

Also, make sure your resource file properties have BuildAction set to EmbeddedResource.

EDIT: If all you're retrieving from your resource file is a string, have you tried simply referencing the resource?

string header = <MyNamespace>.RessourceFile.EmailHeader;
Michael Petrotta
thanks, "string header = <MyNamespace>.RessourceFile.EmailHeader;" works, it is exactly what I was looking for.