Today while trying to create Package for a project through Visual Studio, it started to give below error:
Both “Site definitions” and “Site definitions” contain a file that deploys to the same Package location: SiteTemplates\Admin project\default.aspx
Googled for it, but it gave no trace of such error message, so was now on my own to find the cause for this problem.
One thing was evident that, in site templates, there was this file “default.aspx” (as shown in error message) that was targeted more then once to same location somewhere in the solution. Now we had more then one site templates, and had created few of them recently by copying the file “default.aspx” to newly created templates by copying from older templates. So checked into the “SharePointProjectItem.spdata” file under site definitions. (Note: this file is not shown under Visual Studio’s Solutions Explorer window. But you can manually open it from windows explorer) Once the file was opened, the problem was evident from the entries in it. The problem was that all files copied from older templates to newly created templates had the older target attribute value, that was causing the problem, and was showing up in the error messages Package location value.
The solution: inĀ “SharePointProjectItem.spdata” file, we changed the values of “Target” attributes of allĀ items copied from older templates to point to correct locations, and the problem was solved.