views:

1500

answers:

2

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.

A: 

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 is described here. That way, you can link the Project B resource files into Project A.

Heinzi
+1  A: 

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