ListCollection.Add method

Creates a new list or a document library.

Namespace:  Microsoft.SharePoint.Client
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

public List Add(
	ListCreationInformation parameters


Type: Microsoft.SharePoint.Client.ListCreationInformation

A ListCreationInformation object that represents information associated with the list or document library.

It must not be a null reference (Nothing in Visual Basic).

Return value

Type: Microsoft.SharePoint.Client.List
Returns a List instance representing the creation of list or a document library.


ListCreationInformation.Url is not valid.


Entity specified in ListCreationInformation.DataSourceProperties or the specified SpecificFinder does not exist on the server. Error code: -1.


Entity specified in ListCreationInformation.DataSourceProperties does not have a View with the specified SpecificFinder. Error code: -2146232832.


The location for list does not exist, the current user has insufficient permissions to perform the operation, ListCreationInformation.Title is a null reference (Nothing in Visual Basic), ListCreationInformation.Url is not valid, or another list with the title already exists in the site. Error code: -2130575342.


List server template is not valid. Error code: -2130575237.


Feature does not exist. Error code: -2130246262.


The list server template is not valid.

The current user has insufficient permissions. Error code: -2147024891.

This code example creates two new announcements lists and adds them to the list collection of the current web site.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
    class ListCollection_AddExample

        static void Main()
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;
            ListCollection collList = site.Lists;

            ListCreationInformation lci1 = new ListCreationInformation();
            lci1.Title = "New Announcements";
            lci1.TemplateType = (int)ListTemplateType.Announcements;

            ListCreationInformation lci2 = new ListCreationInformation();
            lci2.Title = "Old Announcements";
            lci2.TemplateType = (int)ListTemplateType.Announcements;


            Console.WriteLine("Lists on the current site:\n\n");
            foreach (List targetList in collList)