Ошибка с декларативным развертыванием поля столбца сайта поиска - PullRequest
0 голосов
/ 31 января 2020

Я развертываю с Visual Studio решение SharePoint 2016, содержащее две таблицы: TestL1 и TestL2. Таблица TestL2 содержит поле поиска, связанное с таблицей TestL1. Развертывание завершается с ошибкой:

Error occurred in deployment step 'Activate Features': <nativehr>0x80070057</nativehr><nativestack></nativestack>

В журналах нет дополнительной информации. Я не понимаю, что не так.

У меня есть следующие столбцы сайта:

TestL1 (столбец сайта)

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Field
       ID="{98af2538-0eee-4b33-a1a2-03044fbd60e6}"
       Name="TestL1"
       StaticName="TestL1"
       DisplayName="TestL1"
       Type="Text"
       Required="TRUE"
       Group="Custom Site Columns">
  </Field>
</Elements>

TestL2 (столбец сайта)

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Field
       ID="{67ad15c4-28bc-42ae-887c-840457a6951c}"
       Name="TestL2"
       StaticName="TestL2"
       DisplayName="TestL2"
       Type="Lookup"
       EnableLookup="TRUE"
       List="Lists/TestL1"
       Required="TRUE"
       ShowField="TestL1"
       Group="Custom Site Columns"
       Overwrite="FALSE">
  </Field>
</Elements>

Столбцы сайта содержатся в следующих типах контента:

TestL1 (тип контента)

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x010077C16C7CCC984469B0D5057094903A28" Name="TestL1" Group="Custom Content Types" Description="My Content Type" Inherits="TRUE" Version="0">
    <FieldRefs>
      <FieldRef ID="{98af2538-0eee-4b33-a1a2-03044fbd60e6}" DisplayName="TestL1" Required="TRUE" Name="TestL1" />
    </FieldRefs>
  </ContentType>
</Elements>

TestL2 (тип контента)

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x010060BA907756EE4B299931BF235C8013AA" Name="TestL2" Group="Custom Content Types" Description="My Content Type" Inherits="TRUE" Version="0">
    <FieldRefs>
      <FieldRef ID="{67ad15c4-28bc-42ae-887c-840457a6951c}" DisplayName="TestL2" Required="TRUE" Name="TestL2" />
    </FieldRefs>
  </ContentType>
</Elements>

Типы контента связаны в следующих списках:

TestL1 (схема списка)

<List xmlns:ows="Microsoft SharePoint" Title="TestL1" FolderCreation="FALSE" Direction="$Resources:Direction;" EnableContentTypes="TRUE" Url="Lists/TestL1" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
  <MetaData>
    <ContentTypes>
      <ContentTypeRef ID="0x010077C16C7CCC984469B0D5057094903A28">
        <Folder TargetName="Item" />
      </ContentTypeRef>
      <ContentTypeRef ID="0x0120" />
    </ContentTypes>
    <Fields>
      <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="$Resources:core,Title;" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" MaxLength="255" />
    </Fields>
    <Views>
      <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>
          <FieldRef Name="LinkTitleNoMenu"></FieldRef>
        </ViewFields>
        <Query>
          <OrderBy>
            <FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
          </OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
        </ParameterBindings>
      </View>
      <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/15/images/generic.png?rev=23" Url="AllItems.aspx">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <JSLink>clienttemplates.js</JSLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>
          <FieldRef Name="LinkTitle"></FieldRef>
        </ViewFields>
        <Query>
          <OrderBy>
            <FieldRef Name="ID"></FieldRef>
          </OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
        </ParameterBindings>
      </View>
    </Views>
    <Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    </Forms>
  </MetaData>
</List>

TestL1 (экземпляр списка)

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="TestL1"
                OnQuickLaunch="TRUE"
                TemplateType="100"
                Url="Lists/TestL1"
                Description="My List Instance">
  </ListInstance>
</Elements>

TestL2 (схема списка)

<List xmlns:ows="Microsoft SharePoint" Title="TestL2" EnableContentTypes="TRUE" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/TestL2" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
  <MetaData>
    <ContentTypes>
      <ContentTypeRef ID="0x010060BA907756EE4B299931BF235C8013AA">
        <Folder TargetName="Item" />
      </ContentTypeRef>
      <ContentTypeRef ID="0x0120" />
    </ContentTypes>
    <Fields>
      <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="$Resources:core,Title;" Required="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" MaxLength="255" />
    </Fields>
    <Views>
      <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>
          <FieldRef Name="LinkTitleNoMenu"></FieldRef>
        </ViewFields>
        <Query>
          <OrderBy>
            <FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
          </OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
        </ParameterBindings>
      </View>
      <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/15/images/generic.png?rev=23" Url="AllItems.aspx">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <JSLink>clienttemplates.js</JSLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>
          <FieldRef Name="LinkTitle"></FieldRef>
        </ViewFields>
        <Query>
          <OrderBy>
            <FieldRef Name="ID"></FieldRef>
          </OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
        </ParameterBindings>
      </View>
    </Views>
    <Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    </Forms>
  </MetaData>
</List>

TestL2 (экземпляр списка)

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="TestL2"
                OnQuickLaunch="TRUE"
                TemplateType="100"
                Url="Lists/TestL2"
                Description="My List Instance">
  </ListInstance>
</Elements>

Эти элементы активируются в 6 функциях, упорядоченных следующим образом:

  • Feature1TestL1SiteColumn
    • TestL1SiteColumn
  • Feature2TestL2SiteColumn
    • TestL2SiteColumn
  • Feature3TestL1ContentType
    • TestL1ContentType
  • TestL2ContentType
Feature5TestL1List
  • TestL1ListInstance
  • TestL1ListDefinition
Feature6TestL2List * TestL2ListInstance TestL2ListDefinition

Развертывание не удалось активировать функцию Feature6TestL2List

...