Step 1: Create a Windows Application or Console Application.(I am taking Windows Forms Application here)
Step 2: "Microsoft.SharePoint.Client.dll" and "Microsoft.SharePoint.Client.Runtime.dll"
Step 3: Code Snippet
Step 4: Site Created Successfully.

create a site using Client Object Model using Sharepoint Foundation
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegisterMembers onlyeBook · SharePointSharePoint Online And Office 365 AdministrationDownload nowWrite a blog post and earn +250 SHARP when it is approved.
Write a blog
Abhinav SoodPosted Sep 26, 2012, 2:08 AM EDT
Anyways Thanks, I got it Here is the code ClientContext clientContext = new ClientContext("http://sitename"); WebCollection collWeb = clientContext.Web.Webs; WebCreationInformation webCreationInfo = new WebCreationInformation(); webCreationInfo.Title = "New Site Name"; webCreationInfo.Description = "Describe your Site here"; webCreationInfo.Language = 1033; webCreationInfo.Url = "URL OF SITE"; webCreationInfo.UseSamePermissionsAsParentSite = true; webCreationInfo.WebTemplate = "STS#0"; Web oNewWebsite = collWeb.Add(webCreationInfo); clientContext.ExecuteQuery(); MessageBox.Show("Site Created");
Abhinav SoodPosted Sep 26, 2012, 2:08 AM EDT
Anyways Thanks, I got it Here is the code ClientContext clientContext = new ClientContext("http://sitename"); WebCollection collWeb = clientContext.Web.Webs; WebCreationInformation webCreationInfo = new WebCreationInformation(); webCreationInfo.Title = "New Site Name"; webCreationInfo.Description = "Describe your Site here"; webCreationInfo.Language = 1033; webCreationInfo.Url = "URL OF SITE"; webCreationInfo.UseSamePermissionsAsParentSite = true; webCreationInfo.WebTemplate = "STS#0"; Web oNewWebsite = collWeb.Add(webCreationInfo); clientContext.ExecuteQuery(); MessageBox.Show("Site Created");
Abhinav SoodPosted Sep 26, 2012, 1:36 AM EDT
i am not able to see code