Hello, I have a problem creating a site collection from my onet.xml. I guess the list “Pages” is not created correctly. What do I need to get it created?
The error message;
Failed to instantiate file "Default.aspx" from module "ProjectPortalHome": The specified list does not exist.
The Module element;
<Module Name="ProjectPortalHome" Url="$Resources:cmscore,List_Pages_UrlName;" Path=""><File Url="Default.aspx" Type="GhostableInLibrary"><Property Name="Title" Value="$Resources:spscore,HomeLandingPage_Title;" /><Property Name="ContentType" Value="$Resources:saabprojectportal,ContentType_ProjectPortal_Name;" /><Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/ProjectPortal.aspx, $Resources:saabprojectportal,PageLayout_ProjectPortal_Title;" /></< FONT><File></< FONT><Module>
The Configuration element;
<Configuration ID="0" Name="Default"><Lists /><Modules><Module Name="ProjectPortalHome" /></Modules><SiteFeatures><!-- PublishingSite --><Feature ID="F6924D36-2FA8-4f0b-B16D-06B7250180FA" /><!-- BaseSite --><Feature ID="B21B090C-C796-4b0f-AC0F-7EF1659C20AE" /><!-- BasicWebParts Feature --><Feature ID="00BFEA71-1C5E-4A24-B310-BA51C3EB7A57" /><!-- Three-state Workflow Feature --><Feature ID="FDE5D850-671E-4143-950A-87B473922DC7" /></SiteFeatures><WebFeatures><Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5" /><!-- TeamCollab Feature --><Feature ID="F41CC668-37E5-4743-B4A8-74D1DB3FD8A4" /><!-- MobilityRedirect --></WebFeatures></Configuration>
Solved
In case anyone else has this problem try to
change Type="GhostableInLibrary" to Type="Ghostable"
Additional
I have came across this problem a few times.
I found the best thing to do, is to delete the module from the feature. Then add a new one and add the files which you want to upload in the .wsp and the problem should be solved.
difference bewteen GhostableInLibrary and Ghostable
你可能在处理Sharepoint的element manifest file时会遇到File节中的Type属性的设置,此属性有两个可选项:Ghostable与GhostableInLibrary。 如果你不设置它,则默认的会为"Unghostable"。此属性的设置到底是什么意思呢?
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" ><Module Name="WP_Stm_DataSync" List="113" Url="_catalogs/wp"><File Path="WP_Stm_IntranetPatch_NexusDataSync\WP_Stm_DataSync.webpart" Url="WP_Stm_DataSync.webpart" Type="GhostableInLibrary"><Property Name="Group" Value="Custom" /></File></Module>
</Elements>
一、Ghostable与GhostableInLibrary:
当你设置了它们时,此File就会在WFE(Web Front End服务器(WFE))的Cache中驻留,虽然都是驻留,但在处理方式上有差异1、如果你设置的值为GhostableInLibrary,则此File会被作为特定的List的Item来对待,所谓特定的List是指此List的Base Type是Document Library,所谓的对待方式就是你可以Check-in, Check-out,Version history等等Document Library List的Item应该具有的操作方式。2、而如果你设置的值为Ghostable,则此File只会被作为普通的List Item来对待。 而Cache的工作方式是,例如:你修改了Sharepoin某个页面的内容,Sharepoint要做的事情就是把修改前后发生变化的那部分及时保存到database中,下次再显示此页面时,就会把cache在WFE Memory中的原页面内容与从database中取出的变化部分进行整合,从而创建出修改后的页面内容然后呈现到客户端。你可以做一个测试,在Sharepiont网站中创建一个Custom List,此List不继承自Document Library,然后创建一个Item级的Feature,在其Element.xml中采用GhostableInLibrary设置,把此Feature
部署到你创建的Custom List中,你会发现在此Custom List中Items中你找不到你刚才部署的Feature,原因很简单,因为此Custom List不是Document Library类型的List,而其Item Feature的部署又采取的是针对
Documenty Library List类型的部署方式,所以就此产生了所谓的"Ghost" Item。如果把刚才创建的Feature修改为Ghostable方式,重新部署,你就会在你的Custom List中找到你部署的Feature了。
二、而如果你不设置Type值,则其工作方式就是"Unghostable"
即:此File不再Cache在WFE的Memory中,而是全部保存到database中,下次要呈现时,就全部从database中去取出来。