pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
416 stars 643 forks source link

Apply-PnPProvisioningTemplate : Expected hex 0x in '{0}'. #1814

Open khha opened 6 years ago

khha commented 6 years ago

Category

[ X] Bug [ ] Enhancement

Environment

[ ] Office 365 / SharePoint Online [ ] SharePoint 2016 [ X] SharePoint 2013

If SharePoint on-premises, what's exact CU version: 15.0.4569.1506

Expected or Desired Behavior

I expect a new created contenttype.

Observed Behavior

I downloaded the latest sharepoint 2013 pnp powershell msi file (June 2018 Release, 2.27.1806.0 ). I created a pnp template to create a new manage metadata field. I run the pnp powershell command "Apply-PnPProvisioningTemplate".

I receive this error:

Apply-PnPProvisioningTemplate : Expected hex 0x in '{0}'.
At line:1 char:1
+ Apply-PnPProvisioningTemplate -Path C:\siteprovisioninglist.xml
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate

Here is my pnp template:

<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2018/01/ProvisioningSchema">
  <pnp:Preferences Generator="OfficeDevPnP.Core, Version=2.23.1802.0, Culture=neutral, PublicKeyToken=5e633289e95c321a" />
  <pnp:Templates ID="CONTAINER-TEMPLATE-DD8FF2411C6D4EEEA6A0A5349D4F0AFD">
    <pnp:ProvisioningTemplate ID="TEMPLATE-DD8FF2411C6D4EEEA6A0A5349D4F0AFD" Version="1" BaseSiteTemplate="STS#0" Scope="RootSite">

      <pnp:SiteFields>
        <Field ID="{e57deba6-e093-4e74-86dc-6bde1714f0ef}" Name="OK-SiteNaam" DisplayName="Tile naam" Type="Text" Required="TRUE" Group="OK Provisioning - Sites" SourceID="{8e81f00e-59ab-476e-b91a-99381ae2bc88}" StaticName="OK-SiteNaam">
        </Field>
      </pnp:SiteFields>

      <pnp:ContentTypes>
        <pnp:ContentType ID="0x0100D3BE795F24B64CE69795F188661ED20100C7803535EEC64F3298376DA80AFB3CE3" Name="OK Site Provisioning Item Department" Description="OK" Group="OK" >
          <pnp:FieldRefs>
            <pnp:FieldRef ID="fa564e0f-0c70-4ab9-b863-0177e6ddd247" Name="Title" Required="true" />
            <pnp:FieldRef ID="e57deba6-e093-4e74-86dc-6bde1714f0ef" Name="OK-SiteNaam" Required="true" />
          </pnp:FieldRefs>
        </pnp:ContentType>
      </pnp:ContentTypes>
    </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>
aslanovsergey commented 4 years ago

I have the same issue and it's related to ContentTypes. Does somebody know a solution?

lancegosby commented 3 years ago

I was getting the same error when I tried to provision Metadata Navigation settings.

I tried this first:

  <pnp:Navigation AddNewPagesToNavigation="true" CreateFriendlyUrlsForNewPages="true">
    <pnp:GlobalNavigation NavigationType="Managed">
      <pnp:ManagedNavigation TermStoreId="{sitecollectiontermstoreid}" TermSetId="{sitecollectiontermsetid:Termset Name}" />
    </pnp:GlobalNavigation>
  </pnp:Navigation>   

When I take the spaces out of the termset name that I am using in the TermSetId attribute, it works perfectly.

<pnp:ManagedNavigation TermStoreId="{sitecollectiontermstoreid}" TermSetId="{sitecollectiontermsetid:TermsetName}" />

I got the idea from StackExchange.