The container node already has too many nodes

Manasa Gowda 1 Reputation point

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.


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

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

        //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);  
        return true;  

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

    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:

    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

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

    0 comments No comments

  3. Manasa Gowda 1 Reputation point

    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

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

    0 comments No comments