SharePoint 2013 – The file or folder name “_catalogs” contains invalid characters

The file or folder name “_catalogs” contains invalid characters

I am trying to deploy a master page in SharePoint 2013:

[code lang=text]
<Module Name=“MasterPages2013“ Url=“_catalogs/masterpage/“ >

<File Path=“MasterPages2013\MyMaster2013.html“ Url=“MyMaster2013.html“ Type=“GhostableInLibrary“ Level=“Draft” ReplaceContent=“true“>

<Property Name=“ContentTypeId“ Value=“0x01010500BF544AFE46ACEF42B8DA22C9CE89526E“ />

<Property Name=“UIVersion“ Value=“15“ />

<Property Name=“Title“ Value=“Your Master Page Title“ />

<Property Name=“ContentType“ Value=“Master Page“ />

<Property Name=“_ModerationStatus“ Value=“0“ />

<Property Name=“FSObjType“ Value=“0“ />

</File>

<File Path=“MasterPages2013\MyMaster2013.master“ Url=“MyMaster2013.master“ Type=“GhostableInLibrary“ Level=“Draft“ ReplaceContent=“true“>

<Property Name=“ContentTypeId“ Value=“0x01010500BF544AFE46ACEF42B8DA22C9CE89526E“ />

<Property Name=“UIVersion“ Value=“15“ />

<Property Name=“Title“ Value=“Your Master Page Title“ />

<Property Name=“ContentType“ Value=“Master Page“ />

<Property Name=“_ModerationStatus“ Value=“0“ />

<Property Name=“FSObjType“ Value=“0“ />

</File>

</Module>
[/code]

When I deploy the solution I’m getting the following:

Error occurred in deployment step ‘Activate Features’: The file or folder name “_catalogs” contains invalid characters. Please use a different name. Common invalid characters include the following: # % & * : ? /  { | }

Solution

The problem is in the following line:

[code lang=text]
<Module Name=“MasterPages2013“ Url=“_catalogs/masterpage/IMOBranding2013/“ >
[/code]

The additional ‘/’ had to be removed from the Url. Changing it to the following worked:

[code lang=text]
<Module Name=“MasterPages2013“ Url=“_catalogs/masterpage/IMOBranding2013/“ >
[/code]

Additional Note

The same error also occurs when the Url inside the field starts with a ‘/’

[code lang=text]
<File Path=“MasterPages2013\MyMaster2013.master“ Url=“/MyMaster2013.master” … />
[/code]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: