Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to access my language localization resource file which is in the same solution, but in a different project then the one I am currently working on. I don't want to use multiple resource files so how do I access a resource file in a different project when working within xml?

Here is what I have so far, but this accesses the resource file in the same project:

  <CustomAction Id="WorkflowConfig" 
            GroupId="ProjectSiteSettings"
            Location="Microsoft.SharePoint.SiteSettings" 
            RequireSiteAdministrator="TRUE"
            Sequence="130"
            Title="$Resources:WorkflowConfig"
            >
share|improve this question

3 Answers 3

up vote 3 down vote accepted

For shared resource files in SharePoint (i.e. RESX files that must be shared amongst Features/Projects/Solutions), the best thing to do is to deploy them to the SharePoint Root's "Resources" folder (14/Resources). Then you'd reference them in one of two ways.

In the RESX reference, you can specify the file name in the RESX reference like so (leaving off the .resx file extension):

Title="$Resources:myCustomRESXFile,WorkflowConfig"

Assuming using Visual Studio 2010 tools, modify "Default Resource File" property of the feature (in the properties editor while the Feature is open).

This describes the process for a List, Content Types, Fields, but just as applicable to a element:

http://msdn.microsoft.com/en-us/library/ff955226.aspx

Note, if this is a Sandboxed Solution, you may have problems because the RESX support for Sandboxed features is limited and inconsistent. See my question on this topic: Sandbox Content Type and Resource (RESX) File

share|improve this answer

If you want to be able to reuse the same resource file in multiple solutions then you should place it in the {SharePointRoot}\Resources folder.
Make sure you give the .resx file a name which will be unique as you can't put it in a seperate folder. If you give the file the name Meyer.Denney.Workflow.resx then you can access the WorkflowConfig using

$Resources:Meyer.Denney.Workflow,WorkflowConfig;
share|improve this answer
    
Yeah, don't name the RESX file core.resx...you'd overwrite an pretty important RESX file from SharePoint. :) –  Brian Mar 26 '12 at 19:54

You can use following:

$Resources:FileName,Key;

File name should be without extension. But do not foget to setup feature dependency if your xml is located in another feature as resources files.

share|improve this answer
    
I tried using that "$Resources:LanguageLocalization,WorkflowConfig" but with no luck. Do I need to add the project or namespace the FileName is in? –  Meyer Denney Mar 26 '12 at 19:38
1  
Try to reset iis. There is an issue when resources files are not accessable after deployment. –  Alexander Mar 26 '12 at 19:40

Your Answer

 
discard

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.