Search code examples
.netresourcemanager

ResourceManager trying to load .resources not .resx file


I am trying to load a resx file in my .net website using:

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

The Resource.resx file is in the folder App_LocalResources and is set to be embedded in assembly on build.

When I try to access the resx file using:

rm.GetString( "key" ); or rm.GetString( "key", culture );

I get an error message:

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

Notice the .resources ... any ideas on what is going on here?


Solution

  • I think the way you are using ResourceManager is wrong. See this post.

    Also note, when you open Visual Studio command prompt, & run resgen.exe, it says its used to convert resource files from one format to another (i.e. resx to resources). I think, you will need to convert your file to resources from resx & then load it using resourceManager.