I love my day job
Error when creating a site from a custom template: "A duplicate name 'FieldName' was found" - SharePoint Skater

SharePoint Skater

Custom control and client script aficionado, neck-deep in a simmering SharePoint stew.

Error when creating a site from a custom template: "A duplicate name 'FieldName' was found"

This happened to me in a client's WSS3 environment, but it seems to apply to 2010 as well. I had a site template created in one environment, but upon moving it to another, the Create Site operation resulted in a neat little error, complete with stack trace: "A duplicate name 'YourField' was found". Upon investigating, I found that one of the lists in the newly-created site did indeed have duplicate fields. What was odd in this case was that the the list was based on a content type, and only one of the duplicates came from said content type. I deleted the extra fields, re-saved the template in the new environment, and created again -- only to have similar results. Several forum posts recommend cutting open the template on your local machine, editing the XML, and rebuilding the solution CAB, but in my case, all it took was a quick "Delete list" followed by re-creating it and re-adding the content type. Save as template again, and this time -- instant site creation satisfaction.

Comments

No Comments