I have two projects in my VS solution, a project named "B" is a SharePoint 2010 project which has a mapped SharePoint "Layouts\js" folder and some other project "A".

In project "B" I put various files in the "Layouts\js" folder which are deployed when I hit deploy from VS2010. But if I add existing item from project "A" "someFile.js" with the option "Add As Link" to "Layouts\js" in project "B", the linked item is not deployed when I hit deploy from VS2010.

Why does this not work?

I want to be able to have only one copy of "someFile.js" across both projects, and I want "someFile.js" to be deployed in "Layouts\js" when I hit Deploy from VS2010.

How can I achieve this?

1 Answer 1


The link won't be handled by the package builder.

You can, however, edit manually the spdata file to "link" the files.

For example, I use this technique to link resources files. I have to deploy resx both in \14\resources and \app_globalresources. To avoid duplicating the file, I change the spdata file like this :

    SupportedDeploymentScopes="Web, Site, WebApplication, Farm, Package"         xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
    <ProjectItemFile Source="Elements.xml" Target="App_GlobalResources\" Type="ElementManifest" />
    <ProjectItemFile Source="..\Resources\my.resx"
    <ProjectItemFile Source="..\Resources\my.fr-FR.resx"

When the package will be build, the files will be taken from the relative path.

More on this in this article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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