部署3个ContentTypes使用1功能 - 只有2被部署 [英] Deploy 3 ContentTypes using 1 Feature - Only 2 gets deployed

查看:152
本文介绍了部署3个ContentTypes使用1功能 - 只有2被部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个功能,它具有定义多种内容类型的以下清单文件:

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/">
  <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">
        <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
          <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">
        <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
          <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>

所以,有3个CT,但是第一个没有部署。它不是隐藏的,因为当检查SPWeb.AvailableContentTypes - 没有这样的CT可用。

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.


  • CType的ID是唯一的。

  • 接收者类是公开的
    可用。

  • 参考字段也是
    可用。

  • 尝试这在一个新鲜的网络应用程序上。

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

哦,可能是错的?

推荐答案

解决。

那些<! - - > 标签之间的注释阻止了此内容类型的部署。

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

这篇关于部署3个ContentTypes使用1功能 - 只有2被部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆