The container node already has too many nodes

Manasa Gowda 1 Reputation point
2022-06-23T06:36:50.633+00:00

While creating subsite getting error "The container node already has too many nodes". It was working from many years but from last one month we are facing an error.

EF:-4.5
references:
Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll
Microsoft.SharePoint.Client.Publishing.dll
Microsoft.SharePoint.Client.UserProfiles.dll

Please check attached file and below214231-error.png code:

public bool InsertAskSubSite(string level3Title, string templateType, string description, string titleName, NavigationNodeCreationInformation node)

    {  
        //working  
        //Create The Blog SubSIte in Sharepoint Site  
        if (string.IsNullOrEmpty(description))  
        {  
            description = titleName;  
        }  
        WebCreationInformation webASk = new WebCreationInformation();            
        webASk.Url = level3Title;  
        webASk.Title = titleName + " " + OMDALConstants.Ask;  
        webASk.Description = description;  
        webASk.UseSamePermissionsAsParentSite = true;  
        webASk.WebTemplate = templateType;  
        webASk.Language = 1033;  
        Web webAskAdd = ClientContext.Site.RootWeb.Webs.Add(webASk);  
       var NavigationTitle = webAskAdd.Navigation.TopNavigationBar.Add(node);  
        ClientContext.ExecuteQuery();  
        return true;  

    }  
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,938 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,547 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,557 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Tong Zhang_MSFT 9,111 Reputation points
    2022-06-24T03:39:46.903+00:00

    Hi @Manasa Gowda ,

    Per my test, unfortunately, I can not reproduce your issue. The code works well in my test. As a troubleshooting, please try to delete var NavigationTitle = webAskAdd.Navigation.TopNavigationBar.Add(node); in your code and run it again.

    More information for reference:
    https://www.codesharepoint.com/csom/create-sub-site-in-sharepoint-using-csom


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  2. Manasa Gowda 1 Reputation point
    2022-06-24T05:52:31.617+00:00

    Thank you for your response. Let me check and get back to you.

    0 comments No comments

  3. Manasa Gowda 1 Reputation point
    2022-06-28T06:08:08.817+00:00

    I removed the line var NavigationTitle = webAskAdd.Navigation.TopNavigationBar.Add(node); and tried creating subsite but still facing the same error.

    Is there any other way to find solution.


  4. Manasa Gowda 1 Reputation point
    2022-06-29T04:17:25.447+00:00

    We have more than 12 environment, in all the sites getting the same error while creating ASK,BLOG subsite.

    0 comments No comments