Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How to create List and libraries with CustomSchemaXml property using SchemaXml with CSOM in sharePoint online2010????

I am using following Code...

// Create new list for restore List Item from List Schema XML
 ListCreationInformation listCreationInformation = new ListCreationInformation();


listCreationInformation.Title = "my_List_Name";


listCreationInformation.TemplateType = int.Parse(listServTemplate);


listCreationInformation.Description = listDescription;


listCreationInformation.QuickLaunchOption = QuickLaunchOptions.DefaultValue;


listCreationInformation.CustomSchemaXml = listCustomSchemaXml;//variable to 
store             schemaXML as string reading schema.xml file



ctx.Web.Lists.Add(listCreationInformation);



ctx.ExecuteQuery();

It is giving an exception "Invalid list template".

I am using ClientContext for user Authentication in Client Side Object Model...

Need suitable solution...

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.