Could not find any resources appropriate for the specified culture or the neutral culture.(MULTILINGUAL?

Could not find any resources appropriate for the specified culture or the neutral culture

  • I have two ASP.NET Web projects (ProjectA and ProjectB). When class in ProjectA is instantiating a class of ProjectB which uses a resource file Blah.resx, I get this error: An exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll but was not handled in user code. Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resources.Blah.resources" was correctly embedded or linked into assembly "App_GlobalResources.sn_flri6" at compile time, or that all the satellite assemblies required are loadable and fully signed. Whats causing this? There is an article on Microsoft's site about this http://support.microsoft.com/kb/318603 which suggests: To resolve this problem, move all of the other class definitions so that they appear after the form's class definition. This is a solution for Windows Forms project, I'm not sure if that also applies to Web projects.

  • Answer:

    I just hit this same exception in a WPF project. The issue occurred within an assembly that we recently moved to another namespace (ProblemAssembly.Support to ProblemAssembly.Controls). The exception was happening when trying to access resources from a second resource file that exists in the assembly. Turns out the additional resource file did not properly move references from the old namespace name to the new namespace name. In the designer.cs for the resource file, there is a static property to get the ResourceManager. Within that getter, the string was still referring the old namespace. Once correcting it to the new namespace, the problem was resolved: global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProblemAssembly.Support.Properties.Stuff", typeof(Stuff).Assembly); should have been: global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProblemAssembly.Controls.Properties.Stuff", typeof(Stuff).Assembly); Hope this helps the next person, Craig

dev.e.loper at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

One approach would be to put the shared classes/resources in a separate class library project and refer them in both the web sites.

Subbu

Just because you are referencing Project B's DLL doesn't mean that the Resource Manager of Project A is aware of Project B's App_GlobalResources directory. Are you using web site projects or web application projects? In the latter, Visual Studio should allow you to link source code files (not sure about the former, I've never used them). This is a little-know but useful feature, which http://support.microsoft.com/?scid=kb%3Ben-us%3B306234. That way, you can link the Project B resource files into Project A.

Heinzi

Thanks @CFinck ! Just to add a tip to others : I changed the ResourceManager line with this : New Global.System.Resources.ResourceManager(Reflection.Assembly.GetCallingAssembly.GetName.Name & ".CommonNameOf.Resources", Reflection.Assembly.GetCallingAssembly()) I'm in vb.net but I think in C# the only difference would be + instead of & to concatenate strings. This way I can use the same linked assembly files in two similar projects that share the resources.

Mathieu Leblanc

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.