Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've deployed a custom page layout using a module in a feature, like this:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="MasterPagesAndPageLayouts" Url="_catalogs/masterpage" RootWebOnly="True">
      <File Path="MasterPagesAndPageLayouts\CustomWelcomePage.aspx" Url="CustomWelcomePage.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="True">
          <Property Name="ContentType"
                    Value="$Resources:cmscore,contenttype_pagelayout_name;"/>
          <Property Name="PublishingAssociatedContentType"
                    Value=";#Welcome Page;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4;#"/>
          <Property Name="Title" Value="Custom Welcome Page"/>
          <!-- <View List="Lists/Announcements" WebPartZoneID="TopColumn" /> -->
      </File>     
</Module>
</Elements>

This works. However, I'd like to put a listview webpart in one of the web part zones on the page layout whenever a page a created using this layout, so from what I can find on MSDN (boo!) and the web, I need to add a <View> element. If I uncomment the line above, I get the following nasty error at feature activation time. Anyone know what might be causing this? I've tried different permutations of the <View> tag similar to the above, but always resulting in this.

Server Error in '/' Application.
--------------------------------------------------------------------------------

Cannot complete this action.

Please try again.<nativehr>0x80004005</nativehr><nativestack>owssvr.dll: (unresolved symbol, module offset=00000000001C0598) at 0x000007FEEAC10598
owssvr.dll: (unresolved symbol, module offset=00000000001C70C7) at 0x000007FEEAC170C7
owssvr.dll: (unresolved symbol, module offset=00000000001C7DB7) at 0x000007FEEAC17DB7
owssvr.dll: (unresolved symbol, module offset=00000000001C9A1F) at 0x000007FEEAC19A1F
owssvr.dll: (unresolved symbol, module offset=00000000001CA380) at 0x000007FEEAC1A380
owssvr.dll: (unresolved symbol, module offset=00000000001CB042) at 0x000007FEEAC1B042
owssvr.dll: (unresolved symbol, module offset=00000000001CB7FC) at 0x000007FEEAC1B7FC
owssvr.dll: (unresolved symbol, module offset=000000000004193A) at 0x000007FEEAA9193A
mscorwks.dll: (unresolved symbol, module offset=00000000002BE757) at 0x000007FEF794E757
Microsoft.SharePoint.Library.ni.dll: (unresolved symbol, module offset=00000000000E9DA6) at 0x000007FEEB199DA6
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AB88BD) at 0x000007FEEF1288BD
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B23FE6) at 0x000007FEEF193FE6
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001F7339E) at 0x000007FEEF5E339E
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001F76011) at 0x000007FEEF5E6011
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001D8C69E) at 0x000007FEEF3FC69E
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B29174) at 0x000007FEEF199174
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27B07) at 0x000007FEEF197B07
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B277E0) at 0x000007FEEF1977E0
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27E5F) at 0x000007FEEF197E5F
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27F62) at 0x000007FEEF197F62
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B28C47) at 0x000007FEEF198C47
Microsoft.SharePoint.ni.dll
</nativestack> 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: Cannot complete this action.

Please try again.<nativehr>0x80004005</nativehr><nativestack>owssvr.dll: (unresolved symbol, module offset=00000000001C0598) at 0x000007FEEAC10598
owssvr.dll: (unresolved symbol, module offset=00000000001C70C7) at 0x000007FEEAC170C7
owssvr.dll: (unresolved symbol, module offset=00000000001C7DB7) at 0x000007FEEAC17DB7
owssvr.dll: (unresolved symbol, module offset=00000000001C9A1F) at 0x000007FEEAC19A1F
owssvr.dll: (unresolved symbol, module offset=00000000001CA380) at 0x000007FEEAC1A380
owssvr.dll: (unresolved symbol, module offset=00000000001CB042) at 0x000007FEEAC1B042
owssvr.dll: (unresolved symbol, module offset=00000000001CB7FC) at 0x000007FEEAC1B7FC
owssvr.dll: (unresolved symbol, module offset=000000000004193A) at 0x000007FEEAA9193A
mscorwks.dll: (unresolved symbol, module offset=00000000002BE757) at 0x000007FEF794E757
Microsoft.SharePoint.Library.ni.dll: (unresolved symbol, module offset=00000000000E9DA6) at 0x000007FEEB199DA6
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AB88BD) at 0x000007FEEF1288BD
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B23FE6) at 0x000007FEEF193FE6
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001F7339E) at 0x000007FEEF5E339E
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001F76011) at 0x000007FEEF5E6011
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001D8C69E) at 0x000007FEEF3FC69E
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B29174) at 0x000007FEEF199174
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27B07) at 0x000007FEEF197B07
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B277E0) at 0x000007FEEF1977E0
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27E5F) at 0x000007FEEF197E5F
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27F62) at 0x000007FEEF197F62
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B28C47) at 0x000007FEEF198C47
Microsoft.SharePoint.ni.dll
</nativestack>

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[COMException (0x80004005): Cannot complete this action.

Please try again.<nativehr>0x80004005</nativehr><nativestack>owssvr.dll: (unresolved symbol, module offset=00000000001C0598) at 0x000007FEEAC10598
owssvr.dll: (unresolved symbol, module offset=00000000001C70C7) at 0x000007FEEAC170C7
owssvr.dll: (unresolved symbol, module offset=00000000001C7DB7) at 0x000007FEEAC17DB7
owssvr.dll: (unresolved symbol, module offset=00000000001C9A1F) at 0x000007FEEAC19A1F
owssvr.dll: (unresolved symbol, module offset=00000000001CA380) at 0x000007FEEAC1A380
owssvr.dll: (unresolved symbol, module offset=00000000001CB042) at 0x000007FEEAC1B042
owssvr.dll: (unresolved symbol, module offset=00000000001CB7FC) at 0x000007FEEAC1B7FC
owssvr.dll: (unresolved symbol, module offset=000000000004193A) at 0x000007FEEAA9193A
mscorwks.dll: (unresolved symbol, module offset=00000000002BE757) at 0x000007FEF794E757
Microsoft.SharePoint.Library.ni.dll: (unresolved symbol, module offset=00000000000E9DA6) at 0x000007FEEB199DA6
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AB88BD) at 0x000007FEEF1288BD
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B23FE6) at 0x000007FEEF193FE6
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001F7339E) at 0x000007FEEF5E339E
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001F76011) at 0x000007FEEF5E6011
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001D8C69E) at 0x000007FEEF3FC69E
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B29174) at 0x000007FEEF199174
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27B07) at 0x000007FEEF197B07
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B277E0) at 0x000007FEEF1977E0
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27E5F) at 0x000007FEEF197E5F
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B27F62) at 0x000007FEEF197F62
Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B28C47) at 0x000007FEEF198C47
Microsoft.SharePoint.ni.dll
</nativestack>]
   Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext) +0
   Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext) +173

[SPException: Cannot complete this action.

Please try again.]
   Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, Boolean fForce) +23886566
   Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, Boolean fForce) +353
   Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce) +25692687
   Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly) +27797151
   Microsoft.SharePoint.SPFeatureCollection.CheckSameScopeDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, SPFeatureDefinition featdefDependency, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly) +27798618
   Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly, FailureReason& errType) +416
   Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependencies(SPFeatureDefinition featdef, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fThrowError, Boolean fMarkOnly, List`1& missingFeatures) +27798151
   Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependencies(SPFeatureDefinition featdef, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly) +66
   Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly) +27796985
   Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, String featureName, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope) +150
   Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId, Boolean force, SPFeatureDefinitionScope featdefScope) +83
   Microsoft.SharePoint.WebControls.FeatureActivator.ActivateFeature(Guid featid, SPFeatureDefinitionScope featdefScope) +699
   Microsoft.SharePoint.WebControls.FeatureActivatorItem.BtnActivateFeature_Click(Object objSender, EventArgs evtargs) +140
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.5448; ASP.NET Version:2.0.50727.5456 

Update: Ok then, I've now tried to provision this list on a page rather than on the page layout and experience another nasty COM Exception (0x810200a5). Here's my feature XML:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="CustomSiteWelcomePage" Url="$Resources:cmscore,List_Pages_UrlName" SetupPath="SiteTemplates/Publishing">
      <File Url="default.aspx" Type="GhostableInLibrary">
          <!--<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/CustomWelcomePage.aspx"/>
          <Property Name="ContentType"
                    Value=";#Welcome Page;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4;#"/>-->
          <!--<View List="Lists/Announcements" WebPartZoneID="TopColumn" />-->
      </File>
  </Module>
</Elements>

I'm trying to provision a page in the Pages library using the OOB publishing page which uses a custom page layout. I've also tried deploying with the commented-out elements as well as without, both the with same result:

[COMException (0x810200a5): Could not complete this action due to an invalid site or feature definition. Please examine the server logs or contact your administrator for assistance.<nativehr>0x810200a5</nativehr><nativestack></nativestack>]
   Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext) +0
   Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext) +173

[SPException: Could not complete this action due to an invalid site or feature definition. Please examine the server logs or contact your administrator for assistance.]
   Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, Boolean fForce) +23886566
   Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, Boolean fForce) +353
   Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce) +25692687
   Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly) +27797151
   Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, String featureName, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope) +150
   Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId, Boolean force, SPFeatureDefinitionScope featdefScope) +83
   Microsoft.SharePoint.WebControls.FeatureActivator.ActivateFeature(Guid featid, SPFeatureDefinitionScope featdefScope) +699
   Microsoft.SharePoint.WebControls.FeatureActivatorItem.BtnActivateFeature_Click(Object objSender, EventArgs evtargs) +140
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
share|improve this question
add comment

1 Answer

Where is that announcement list located?

You should be able to provision webparts with that method. See here for a good example and explanation.

I've tried to do exactly what you're attempting a few months back with the exception that I wasn't at the root of my site-collection. But since page Layouts are always provisioned at the root, I couldn't get the webpart to show up. I don't remember the specific error I was getting, I think it was an XML error, but you might be hitting a similar issue.

share|improve this answer
    
The issue may be there - the announcement list is located in each subweb of /myserver/sites/mysite. The idea is to have the welcome page for each of those sites provisioned with all the default webparts on it. Perhaps it would be better to just do this in a WebProvisioned event. –  Ben Collins Mar 19 '12 at 14:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.