2

I'm having a hard time wrapping my mind around how the resources work in an ASP.NET project. In my solution I have 2 projects:

  1. A Website project that contains an App_GlobalResources folder where most of my resources reside (build action: "content").
  2. A utility project, compiled as class library (that the website references), where I need another set of resources (called "ExceptionMessages" hereafter).

Nota: each project uses its own resources, there is no cross linking involved here.

I added a new resource directly in my second project (both as "content" or "embeded resource") and tried to access it via ExceptionMessages.Tag. Intellisense is happy about it and correctly suggests the Tag but I get the following error at runtime:

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

Somehow, I don't understand why the webserver is looking for the resource in the App_GlobalResources instead of directly in the assembly where it is used... or how I could go around this in a clean way. Any hint or idea?

Thanks!

Oded
  • 489,969
  • 99
  • 883
  • 1,009
Timothée Bourguignon
  • 2,190
  • 3
  • 23
  • 39
  • Yes the class library assembly is signed. – Timothée Bourguignon May 29 '12 at 09:59
  • Well, __It works on my computer__. Even with an unsigned lib. Your question is seriously short on details. How are the resources accessed, file structure, ... – H H May 29 '12 at 10:17
  • is your resource file other than neutral culture? – Imran Rizvi May 29 '12 at 10:21
  • @HenkHolterman: That's odd. I did not precise that the first project references the second one... could that play a role in there? – Timothée Bourguignon May 29 '12 at 10:22
  • @ImranRizvi: right now it is only the neutral one ; of course I'd like to localize it at some point. – Timothée Bourguignon May 29 '12 at 10:23
  • hmm, check if the link helps you out http://stackoverflow.com/questions/2058441/could-not-find-any-resources-appropriate-for-the-specified-culture-or-the-neutra – Imran Rizvi May 29 '12 at 10:32
  • @ImranRizvi: the designer.cs file specifies `ResourceManager temp = new global::System.Resources.ResourceManager("Resources.ExceptionMessages", global::System.Reflection.Assembly.Load("App_GlobalResources"));` as stated in the question you linked. But when I set the last part to `System.Reflection.Assembly.GetCallingAssembly()` the assembly name changes in the error message but the message is there still... – Timothée Bourguignon May 29 '12 at 10:45

0 Answers0