using (var ctx = new ClientContext(siteUrl)) { var web = ctx.Web; var template = GetProvisioningTemplate(); web.ApplyProvisioningTemplate(template); }
var webUrl = "https://mySharePointSite.com/sites/mySite/myWeb"; var template = GetProvisioningTemplate(); var package = new ProvisioningTemplateApplyingInformation(); package.ProgressDelegate = delegate(string message, int step, int total) { Console.WriteLine(string.Format("{0}/{1} {2}", step, total, message)); }; using (var ctx = new ClientContext(webUrl)) { var web = ctx.Web; web.ApplyProvisioningTemplate(template, package); }In the above example, we are applying a provisioning template to a specific web object by specifying the `WebUrl` parameter using the `ClientContext` object. We are also using the `ProvisioningTemplateApplyingInformation` object to show the progress of the provisioning process. Package Library: Based on the code examples, the package library being used is likely the `Microsoft.SharePoint.Client` package.