Failed to instantiate file__from module__The specified list does
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節(jié)中的Type屬性的設(shè)置,此屬性有兩個可選項:Ghostable與GhostableInLibrary。 如果你不設(shè)置它,則默認的會為"Unghostable"。此屬性的設(shè)置到底是什么意思呢?
<?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:
當你設(shè)置了它們時,此File就會在WFE(Web Front End服務(wù)器(WFE))的Cache中駐留,雖然都是駐留,但在處理方式上有差異1、如果你設(shè)置的值為GhostableInLibrary,則此File會被作為特定的List的Item來對待,所謂特定的List是指此List的Base Type是Document Library,所謂的對待方式就是你可以Check-in, Check-out,Version history等等Document Library List的Item應(yīng)該具有的操作方式。2、而如果你設(shè)置的值為Ghostable,則此File只會被作為普通的List Item來對待。 而Cache的工作方式是,例如:你修改了Sharepoin某個頁面的內(nèi)容,Sharepoint要做的事情就是把修改前后發(fā)生變化的那部分及時保存到database中,下次再顯示此頁面時,就會把cache在WFE Memory中的原頁面內(nèi)容與從database中取出的變化部分進行整合,從而創(chuàng)建出修改后的頁面內(nèi)容然后呈現(xiàn)到客戶端。你可以做一個測試,在Sharepiont網(wǎng)站中創(chuàng)建一個Custom List,此List不繼承自Document Library,然后創(chuàng)建一個Item級的Feature,在其Element.xml中采用GhostableInLibrary設(shè)置,把此Feature部署到你創(chuàng)建的Custom List中,你會發(fā)現(xiàn)在此Custom List中Items中你找不到你剛才部署的Feature,原因很簡單,因為此Custom List不是Document Library類型的List,而其Item Feature的部署又采取的是針對
Documenty Library List類型的部署方式,所以就此產(chǎn)生了所謂的"Ghost" Item。如果把剛才創(chuàng)建的Feature修改為Ghostable方式,重新部署,你就會在你的Custom List中找到你部署的Feature了。
二、而如果你不設(shè)置Type值,則其工作方式就是"Unghostable"
即:此File不再Cache在WFE的Memory中,而是全部保存到database中,下次要呈現(xiàn)時,就全部從database中去取出來。總結(jié)
以上是生活随笔為你收集整理的Failed to instantiate file__from module__The specified list does的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【转】MFC与.NET的区别
- 下一篇: 【转】Magento2 安装系列一 虚拟