title: How can I deploy the same resource files to the 14 hive and global resource folder?
body: <p>I currently have a SharePoint 2010 project which I created an empty element within and created my various resource files. I have set these resources to be deployed as type AppGlobalResource.</p>
  
  <p>This works fine and allows me to access my resource values</p>
  
  <pre><code>&lt;asp:Label ID="myLabel" runat="server" Text="&lt;%$Resources:MyResources, MyLabel %&gt;" /&gt;
  </code></pre>
  
  <p>The next thing I want to be able to do is access the resource values from the code behind. So <a href="http://nickgrattan.wordpress.com/2011/05/24/sharepoint-global-resource-resx-file-locations/" rel="nofollow">I read</a> that to access the values I should use SPUtility.GetLocalizedString.</p>
  
  <p>So I created a helper class like below.</p>
  
  <pre><code>public static class ResourceHelper
  {
  
          public static string GetResourceValue(string resource)
          {
              var lang = SPContext.Current.Web != null ? SPContext.Current.Web.Language : 1033;
              string result = SPUtility.GetLocalizedString("$Resources:" + resource,"RegistrationResource",lang);
  
              return result;
          }
  
  }
  </code></pre>
  
  <p>To access the values using this approach I need to allow deploy my resource files to the hive, which is straightforward enough. Add a mapped SharePoint folder and add the files into there. But the problem is I now have two versions of the files in the same project. So I tried adding the resource files using the <em>Add Existing</em> and then <em>Link To</em> option but it doesn't seem to let you do this.</p>
  
  <p>What is the best way of deploying to the hive and to the Global_ResourceFolder using a SharePoint Feature / Package without having multiple copies of resource files?</p>
  
  <p><strong>EDIT:</strong>
  I have edited the Package.Template.xml file which successfully deploys the file to the hive. But not in the Resources folder. If I amend the location below to use Resources\ or even Resources/ it gives an error saying </p>
  
  <blockquote>
    <p>Error 1   Error occurred in deployment step 'Add Solution': Error:
    Cannot find this file specified in the manifest file:</p>
  </blockquote>
  
  <p>Resources\RegistrationResource.resx
          0   0   Company.Sharepoint.Resources</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Solution xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
    &lt;RootFiles&gt;
      &lt;RootFile Location="RegistrationResource.resx" /&gt;
    &lt;/RootFiles&gt;
  &lt;/Solution&gt;
  </code></pre>