Import Document Sets Issue

Nov 23, 2010 at 6:15 PM

Has anyone had issues importing & deploying a document set content type?

I built up some features using the Import Content Type functionality.

When I deployed the solution & activated the feature, I got this error:

A duplicate name "http://schemas.microsoft.com/sharepoint/v3/contenttype/forms" was found.

This string appears in my two document set content types only.

  <script type="text/javascript">// <![CDATA[ function ULSvam(){var o=new Object;o.ULSTeamName="Microsoft SharePoint Foundation";o.ULSFileName="error.aspx";return o;} var gearPage = document.getElementById('GearPage'); if(null != gearPage) { gearPage.parentNode.removeChild(gearPage); document.title = "Error"; } function _spBodyOnLoad() {ULSvam:; var intialFocus = document.getElementById("errorPageTitleSpan"); try { intialFocus.focus(); } catch(ex) { } } // ]]></script>

Nov 24, 2010 at 8:14 AM

The problem is that CKS:Dev doesn't produce valid XML if a contenttype contains multiple XmlDocument with the same namespace.
If you look at element.xml of a imported documentset contenttype you'll see this: 

      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <act:AllowedContentTypes xmlns:act="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes" LastModified="11/12/2010 16:24:43">
          <AllowedContentType id="0x0101" />
        </act:AllowedContentTypes>
      </XmlDocument>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Display>ListForm</Display>
          <Edit>ListForm</Edit>
          <New>DocSetDisplayForm</New>
        </FormTemplates>
      </XmlDocument>

As you can see in this code smaple there are two XmlDocument nodes with the same NamespaceURI http://schemas.microsoft.com/sharepoint/v3/contenttype/forms
This is your problem and it can easily be fixed by changing the NamespaceURI to something unique:

      <XmlDocument NamespaceURI="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes">
        <act:AllowedContentTypes xmlns:act="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes" LastModified="11/12/2010 16:24:43">
          <AllowedContentType id="0x0101" />
        </act:AllowedContentTypes>
      </XmlDocument>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Display>ListForm</Display>
          <Edit>ListForm</Edit>
          <New>DocSetDisplayForm</New>
        </FormTemplates>
      </XmlDocument>

Nov 24, 2010 at 1:05 PM

Yeah, that's what I figured. I went ahead and excluded the Document Set content types from my solution. Just wanted some verification. Thanks!

Jul 13, 2011 at 1:46 PM

!!! PLEASE NOTE !!!

The solution as suggested by rjaakke , is CORRECT .

But you need to make the same changes in the 'content type' and also in the 'list definition created from the content type'.

- Sangeet Ahuja