Steps
  1. Open Visual Studio in your system.
  2. Select Console Application template and give the name "Enablefolder".
  3. Add a Microsoft.Cleint Assembly reference file in right side reference tab in Visual Studio.
  4. Replace Program.cs with the source code given below.
Code snippet
  1. using System;
  2. using Microsoft.SharePoint.Client;
  3. namespace GowthamArticles
  4. {
  5. class CreateList
  6. {
  7. static void Main()
  8. {
  9. ClientContext clientContext = new ClientContext("https://gowtham.sharepoint.com/tutorials");
  10. ListCreationInformation creationInfo = new ListCreationInformation();
  11. creationInfo.Title = "New TASKList";
  12. creationInfo.Description = "THis Task List created PRogrammatically";
  13. creationInfo.TemplateType = (int)ListTemplateType.Tasks;
  14. web.Lists.Add(creationInfo);
  15. context.ExecuteQuery();
  16. }
  17. }
  18. }