HttpContext.GetGlobalResourceObject always returns null

Shimmy Weitzhandler picture Shimmy Weitzhandler · Jul 4, 2009 · Viewed 8.5k times · Source

I created two files in the App_GlobalResources folder:

SiteResources.en-US.resx
SiteResources.sp-SP.resx

Both contain a value for "SiteTitleSeparator".

Here is what I am trying to do (The following line always returns null):

string sep = (string)GetGlobalResourceObject("SiteResources", "SiteTitle");

Note, that the Culture property on the page is set.

Answers in both VB and C# will be welcomed.

Answer

Shimmy Weitzhandler picture Shimmy Weitzhandler · Jul 5, 2009

I changed the name of SiteResources.en-US.resx to SiteResources.resx and now everything works just fine.

Seems theer must be one invariant resource.