Wednesday, February 5, 2014

Error When Deplying Master page in GhostableInLibrary Files

Below is the code form the elements.xml file from the MasterPages module.

Wrong code Snippet :

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MasterPages">
    <File Path="MasterPages\Portal.master" Url="Portal.master" IgnoreIfAlreadyExists="True"  Type="GhostableInLibrary" />
  </Module>
</Elements>

Correct code snippet :

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MasterPages" Url="_catalogs/masterpage" List="116">
    <File Path="MasterPages\Portal.master" Url="Portal.master" IgnoreIfAlreadyExists="True" Type="GhostableInLibrary" />
  </Module>
</Elements>

No comments:

Post a Comment