x

Error occurred in deployment step 'Activate Features': Failed to instantiate file filename from module modulename: The specified list does not exist

Thursday, November 17, 20110 comments


While deploying a custom page layout through Visual Studio 2010 to a SharePoint 2010 publishing web site, I got the error "Error occurred in deployment step 'Activate Features': Failed to instantiate file "MyCustomPageLayout.aspx" from module "ourlayout": The specified list does not exist." My Elements.xml file code is shown below.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="ourlayout"  Url="_catalogs/ourlayout">
    <File Path="ourlayout\MyCustomPageLayout.aspx" Url="MyCustomPageLayout.aspx" Type="GhostableInLibrary" >
      <Property Name="Title" Value="My Custom Page Layout" />
      <Property Name="ContentType" Value=";$Resources:cmscore,contenttype_pagelayout_name;" />
    </File>
</Module>
</Elements>

So the proble was the path in the Url which was defined as Url="_catalogs/ourlayout". So I have modified the code below and it works for me.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="ourlayout"  Url="_catalogs/masterpage/ourlayout">
    <File Path="ourlayout\MyCustomPageLayout.aspx" Url="MyCustomPageLayout.aspx" Type="GhostableInLibrary" >
      <Property Name="Title" Value="My Custom Page Layout" />
      <Property Name="ContentType" Value=";$Resources:cmscore,contenttype_pagelayout_name;" />
    </File>
</Module>
</Elements>
Share this article :

Post a Comment

 
Copyright © 2010. SharePointDotNet.com - All Rights Reserved
Template Created by Creating Website Published by Mas Template