poiuytrez
poiuytrez

Reputation: 22518

Resource File and MissingManifestResourceFileException

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.

Upvotes: 0

Views: 362

Answers (1)

Michael Petrotta
Michael Petrotta

Reputation: 60902

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;

Upvotes: 1

Related Questions