0

I have some strings in various resx files which I would like to be able to update after publishing the application.

To do this, I changed the resx files' Build Action property to Content, which adds the files to a folder in the output directory and allows for updating the resources.

However, when I try debugging the project in Visual Stuidio after making this change, I get this error when the project tries to retrieve a resource string:

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

This is quite inconvenient, as I will need to change each resources file's Build Action when I need to publish or debug.

What is the best way around this? Should i be using some other method to allow for updating resources after publishing?

Bassie
  • 9,529
  • 8
  • 68
  • 159
  • may be this can help you : https://stackoverflow.com/questions/1923953/could-not-find-any-resources-appropriate-for-the-specified-culture-c-winform-i – Nirzar Sep 19 '17 at 10:10

1 Answers1

0

In MVC I think resource files are compiled into the dll for the project. I think the compiler is telling you that you have set something as content that it needs to compile. Because they get compiled you won't be able to update them without doing updating in your project, building, and redeploying the dll. If you relocate the files to the "App_Code" folder you may be able to access them without compiling.

Joshua Morgan
  • 678
  • 6
  • 18
  • Hi Locke, I'm not quite sure what you mean. Do I need to create a new folder called App_Code in my project and store my resources in there? – Bassie Sep 20 '17 at 02:22
  • You can try that. App_Code is a specially named folder that is used by .net web sites (usually non MVC) to house compiled files. – Joshua Morgan Sep 20 '17 at 13:12