I copied project items (empty elements) from one location to another to reuse them, and when I deployed, I got an error saying: Both [Name1] and [Name1] contain a file that deploys to the same Package location: [Location]

I know I had this error before, and I had to go to Target attribute in spdata for each file to make it unique, but what does this target mean? I am changing stuff but I would like to understand what this change means? where will this value of "target" be deployed and how is it making a conflict?


I don't find any official documentation on that just now, but as far as I know it refers to the location within the SharePoint deployment package, that means within the .wsp file. If you open that file (for example, after changing the file extension to .cab), you can see its internal folder structure.

This structure often (as long as the Type attribute of the ProjectItemFolder or ProjectItemFile node is TemplateFile) corresponds to the structure of the TEMPLATE folder in the SharePoint hive (I mean C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE), like Images, Layouts, FEATURES\YourFeatureNameHere, but there are exceptions as well, where the Type attribute is ElementManifest. These refer to SharePoint element items, stored in separate folders in the .wsp files as well.

Hopefully it helps you to understand the conflicts better.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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