SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i am trying to enable versioning on a ducument library using the client object model my code currently is as follows when i create the document library.

            ClientContext clientContext = getClientContext();
            Web web = clientContext.Web;
            ListCollection listCol = web.Lists;
            ListCreationInformation lci = new ListCreationInformation();
            lci.Title = DocLib;
            lci.TemplateType = (int)ListTemplateType.DocumentLibrary;
            List documentLibrary = listCol.Add(lci);
            documentLibrary.EnableVersioning = true;
            documentLibrary.EnableMinorVersions = true;
            documentLibrary.ContentTypesEnabled = true;
            Console.WriteLine("doclibCreated created");
            return documentLibrary;
        catch (Microsoft.SharePoint.Client.ServerException e)
            return null;

but these settings are not persisted

share|improve this question
up vote 2 down vote accepted

You need to call Update() to apply document library properties:

documentLibrary.ContentTypesEnabled = true;

documentLibrary.Update();   <---- ADDED

share|improve this answer
ah yes that makes sense thatnks alot :) – Sebastien Stettler Oct 4 '11 at 13:16

Your Answer


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.