SharePoint Global Resource (resx) file locations
Global resource (resx) files are stored in the following locations in SharePoint 2010:
- App_GlobalResources folder in the VirtualDirectories folder in inetpub (e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\80)
- Resources folder in the 14 hive (e.g. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Resources)
- Config/Resources folder in the 14 hive (e.g. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\Resources)
In general, a single resx file in your solution should be copied into each of these locations during installation. This is how they are used:
- Resources files in App_GlobalResources are used when code in an ASPX page refers to a resource, e.g.
<asp:Label ID="lblNumberingTitle" runat="server" Text="<%$Resources:GlobalSiteResources, AutoNameTitle %>" />
- Resources files in the Resources folder are used when referencing resources using the SharePoint object model, e.g.
btnExport.Text = SPUtility.GetLocalizedString("$Resources:GlobalSiteResources, Tab_Export", "GloablSiteResources", language);
- Resources files in the Config/Resources are copied into the App_GlobalResources folder whenever a new web application is created. By adding the resx files here you will ensure your application will be able to access its global resource files in new web applications.