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

Join the conversation! Your thoughts help the community grow.