If you’ve arrived at my blog with this error then I apologize, you’ve got a tough road ahead of you, there’s no easy fix to this dreaded “A duplicate field name ‘’ was found” error in SharePoint 2010.
More than likely you’re trying to create a site from a template but you keep getting the “A duplicate field name “ x” was found”. You’ve tried everything, including deleting the old site template, deleting the field in question from the site and the site collection, and you’ve probably even tried to download and modify the template wsp itself but then you can’t makecab it.
I’m not to sure what causes this issue to arise, I’ve come across it about 5 times now and in the case below, where I simply had to fix it, was the first time I attempted to resolve the issue. My theory is that the error arises when the content type syndication hub delivers a content type and its corresponding fields to a site that was created from a backup on another site collection that already had the content type. Now that just a a guess and I’m sure you’re more interested in the solution.
You can see the error by renaming the WSP to .CAB
The place where the duplicates exist is the ElementsFields.xml
Here’s my duplicate field, note how the field is listed twice
Delete and rebuild the site from the bottom up. Sometimes, when dealing with SharePoint, it’s easier to build SharePoint sites from the bottom up as opposed to repairing broken, corrupt, or damaged sites.
So this solution is not for the weary, it involves downloading the site template and repairing it using Visual Studio. The first thing you’ll need is a copy of Visual Studio 2010 Professional or greater installed on a SharePoint Server (DO NOT INSTALL ON YOUR PRODUCTION SHAREPOINT SERVER!!!). With Visual Studio 2010 Professional there’s an import function that will allow you to download a SharePoint site
Open Visual Studio and choose the project type “Import SharePoint Solution Package”.
If you do not see this option then you didn’t read my previous notes that you must install Visual Studio 2010 Professional or greater.
Specify the solution
Allow all items to be imported
The import may take a while
In the solution explorer locate the Elements.xml file
Remove the duplicate field
On the build menu choose “Package”
You may receive a file length error, in my case I had to remove a few files that I included with the solution because I checked the box to include data
If you saved the site as a template and included content, typically the names of the files that are exported will be too long, remove the files and try again. Note that you can remove the files from within Visual Studio. In the screenshot below I cleared all files that were moved with the site. You will obviously have to re-upload this data when the template is re-created but it certainly does not affect the functionality of the site since it is just data, not settings or configuration.
Locate the newly compiles WSP in the Visual Studio 2010 projects folder in the bin/release or bin/debug directory for your solution (Usually it’s c:\users\username\Documents\Visual Studio 2010\Projects)
Rating: 8.7/10 (7 votes cast)
Rating: 0 (from 0 votes)
A duplicate field name “X” was found, 8.7 out of 10 based on 7 ratings
Ulysses Ludwig is a SharePoint architect with over 16 years in the IT and computer industry. Ulysses' primary focus is SharePoint but he dabbles in the latest web technologies and likes to develop software in his spare time.
Problem Users report the following error when attempting to access a document library in SharePoint. An error occurred during the processing of /site/SharedDocuments/Forms/AllItems.aspx. Code blocks...
5 Comments for A duplicate field name “X” was found