views:

150

answers:

1

Hello.

I have a feature which has following manifest file that defines multiple content types:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  <ContentType ID="0x01008e5736f1388b4809a9f102da1e573ddb"
              Name="$Resources:Balticovo,ContentType_AgendaName"
              Group="$Resources:core,CustomContentTypesGroup"
              Description="$Resources:Balticovo,ContentType_AgendaDescription"
              Version="1">
    <FieldRefs>
      <!-- Jautājumu pacēla-->
      <FieldRef ID="{31b28519-c87e-4e0d-9c1b-d02c5e034cf9}" />
      <!-- Kam piešķirts -->
      <FieldRef ID="{53101f38-dd2e-458c-b245-0c236cc13d1a}" />
      <!-- Saistītās personas -->
      <FieldRef ID="{E5C80D9B-4E09-4457-A6A9-5A6F574DEDA5}" />
      <!-- Komentāri -->
      <FieldRef ID="{6df9bd52-550e-4a30-bc31-a4366832a87f}" />
      <!-- Izpildīt līdz -->
      <FieldRef ID="{cd21b4c2-6841-4f9e-a23a-738a65f99889}" />
    </FieldRefs>

    <XmlDocuments>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events"&gt;
        <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events"&gt;
          <Receiver>
            <Name>AgendaToTaskOnAdd</Name>
            <Type>ItemAdded</Type>
            <SequenceNumber>10000</SequenceNumber>
            <Assembly>Balticovo.SharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5</Assembly>
            <Class>Balticovo.SharePoint.AgendaToTask</Class>
            <Data></Data>
            <Filter></Filter>
          </Receiver>
          <Receiver>
            <Name>AgendaToTaskOnUpdate</Name>
            <Type>ItemUpdating</Type>
            <SequenceNumber>10000</SequenceNumber>
            <Assembly>Balticovo.SharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5</Assembly>
            <Class>Balticovo.SharePoint.AgendaToTask</Class>
            <Data></Data>
            <Filter></Filter>
          </Receiver>
        </spe:Receivers>
      </XmlDocument>
    </XmlDocuments>
  </ContentType>

  <ContentType ID="0x0100AD4DFC626A3F4db492A4FCF91B0E47A0"
               Name="$Resources:Balticovo,ContentType_ReglarAttendeeName"
               Group="$Resources:core,CustomContentTypesGroup"
               Description="$Resources:Balticovo,ContentType_ReglarAttendeeDescription"
               Version="1">
    <FieldRefs>
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Required="FALSE" Hidden="TRUE" />
      <FieldRef ID="{37D4FF81-9DE1-436a-B270-923E93258507}" />
    </FieldRefs>
    <XmlDocuments>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events"&gt;
        <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events"&gt;
          <Receiver>
            <Name>AddAttendeeToCurrentMeeting</Name>
            <Type>ItemAdded</Type>
            <SequenceNumber>10000</SequenceNumber>
            <Assembly>Balticovo.SharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5</Assembly>
            <Class>Balticovo.SharePoint.RegularAttendeesEventReceiver</Class>
            <Data></Data>
            <Filter></Filter>
          </Receiver>
        </spe:Receivers>
      </XmlDocument>
    </XmlDocuments>
  </ContentType>

  <ContentType ID="0x01008606FC8499F9407b83AF3DBAD6865F58"
             Name="$Resources:Balticovo,ContentType_WebApplicationQueryName"
             Group="$Resources:core,CustomContentTypesGroup"
             Description="$Resources:Balticovo,ContentType_WebApplicationQueryDescription"
             Version="1">
    <FieldRefs>
      <FieldRef ID="{acbe30d6-ea25-40a2-b6e5-9df76e9c881e}" />
      <FieldRef ID="{6c732395-7404-4ad4-9b03-50195b70c006}" />
      <FieldRef ID="{cb16a530-21ca-43b1-b270-dbb33fa3f7a7}" />
      <FieldRef ID="{bd94a837-82ab-4a8b-b7df-9978cd35f9ec}" />
      <FieldRef ID="{c05e3059-b1fc-4116-8f7d-1cfde24b96f4}" />
      <FieldRef ID="{32fb6f25-cf6e-4e9c-8244-137d017c9348}" />
      <FieldRef ID="{e42ca75d-f017-4eb7-91a6-236dfd71017a}" />
      <FieldRef ID="{EAA39077-D6AF-464e-8052-9001B4E99834}" />
    </FieldRefs>
  </ContentType>

</Elements>

So, there are 3 CT's, however first one doesn't deploy. It's not hidden, because when checking SPWeb.AvailableContentTypes - there is no such CT available.

  • ID of CType is Unique.
  • Receiver classes are publicly available.
  • Referencing fields are also available.
  • Trying this on a fresh web application.

Oh, what could be wrong?

A: 

Solved.

Those <!-- --> comments between tags prevented this content type to be deployed.

Janis Veinbergs
Those comment tags are a problem inside EventReceivers - but not inside CTypes xml defintions.
Henrik
Well, in my case they are a problem in content types.xml definition. Because, as I removed them and recycled app pool - content type showed up immediatelly.
Janis Veinbergs