Error in creating custom site definition in sharepoint 2016

0

I am creating a custom site definition which I'll be using as a site template. I am able to create one with a list and some message on home page. I created one visual web part and added in default.aspx by registering it on default.aspx page.

<%@ Register Tagprefix="MyWebPartControls" Namespace="CustomSiteDefinition.LogonWebPart" Assembly="$SharePoint.Project.AssemblyFullName$" %> 
<MyWebPartControls:LogonWebPart runat="server" />

It is giving result as expected.

Now I want to add some default web parts like "Document Library" on home page.

I am trying to edit in onet.xml.

Adding webpart

As soon as I add above code I am getting following Error.

Error

Find below stack trace.

Cannot complete this action.

Please try again.0x80004005
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.0x80004005

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.0x80004005]
Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) +0
Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) +306

[SPException: Cannot complete this action.

Please try again.]
Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) +45193102 Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) +758
Microsoft.SharePoint.SPWeb.ProvisionWebTemplate(SPWebTemplate webTemplate, String webTemplateToUse, SPFeatureWebTemplate featureWebTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection1& featureDependencyErrors) +1193
Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection
1& featureDependencyErrors) +578
Microsoft.SharePoint.ApplicationPages.TemplatePickerUtil.ApplyWebTemplateAndRedirect(SPWeb Web, String strWebTemplate, Nullable1 bSharedNav, Boolean bOnTopNav, Boolean bOnQuickLaunch, Page page, Boolean bDeleteOnError, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection1& featureDependencyErrors) +2612
Microsoft.SharePoint.ApplicationPages.NewSubwebPage.BtnCreateSubweb_Click(Object sender, EventArgs e) +1019
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11750641
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6016

Even if I try to add some custom web-part , I get these errors.

Any solution will be helpful :)

c#
asp.net
sharepoint
asked on Stack Overflow Jan 10, 2018 by SummiJ • edited Jan 10, 2018 by SummiJ

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0