SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to load one of Microsoft's own resource files so that I can use values contained within in an extended SearchBox web part.

My code to load the resource file is as follows:

Assembly searchAssembly = System.Reflection.Assembly.Load(
    "Microsoft.Office.Server.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c");

ResourceManager s_rmLocStrings = new ResourceManager(
    "Microsoft.Office.Server.Search", searchAssembly);

However, I get the following error:

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

Microsoft.Office.Server.Search.resx (and it's localised version) are both in the app_globalresources, so I think I'm just referring to the resx in the wrong way.

share|improve this question

You could use the regular way of using string resources from SharePoint. Try the following :

SPUtility.GetLocalizedString("TheResourceKey", "TheResourceFile", (uint)culture.LCID);

That way, you will be able to get any resource key from any resource file!

share|improve this answer
That approach is one of the others I looked at but ultimately not the one that solved my problem (posted below). – Neil Richards Nov 22 '10 at 21:22
up vote 1 down vote accepted

So I solved it by using Reflector to see how Microsoft loaded their own assembly and did the following:

AssemblyName name = null;
name = Assembly.Load("Microsoft.Office.Server.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c").GetName();
name.Name = "Microsoft.Office.Server.Search";
AssemblyName assemblyRef = new AssemblyName();
assemblyRef.Name = name.Name + ".Intl";
assemblyRef.Version = name.Version;
assemblyRef.CultureInfo = CultureInfo.InvariantCulture;
Assembly assembly = Assembly.Load(assemblyRef);
s_rmLocStrings = new ResourceManager(name.Name, assembly);

The part that stuffed things up I think is the ".Intl" which has got to be assembly-specific.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.