15 version of the Tenant.dll included#17
15 version of the Tenant.dll included#17VesaJuvonen merged 1 commit intopnp:masterfrom VesaJuvonen:dev
Conversation
Microsoft.Online.SharePoint.Client.Tenant.dll for on-prem (15 version) included in the assemblies folder.
15 version of the Tenant.dll included
|
Hi, I create a site collection in provider hosted apps in high trust.i get this error An exception of type 'Microsoft.SharePoint.Client.ServerException' occurred in Microsoft.SharePoint.Client.Runtime.dll but was not handled in user code Additional information: SiteCreationProperties.Template Parameter name: Specified value is not supported for the SiteCreationProperties.Template parameter. I am using Microsoft.Online.SharePoint.Client.Tenant.dll for on-prem (15 version) But still this error. Below my code is: string appOnlyAccessToken = TokenHelper.GetS2SAccessTokenWithWindowsIdentity(site, null); using (ClientContext clientContext = TokenHelper.GetClientContextWithAccessToken(site.ToString(), appOnlyAccessToken)) { var tenant = new Tenant(clientContext); var newSite = new SiteCreationProperties() { Url = url, Owner = adminAccount, Template = "STS#0", Title = "App provisioned site", StorageMaximumLevel = 1000, StorageWarningLevel = 500, TimeZoneId = 7, UserCodeMaximumLevel = 7, UserCodeWarningLevel = 1 }; //start the SPO operation to create the site SpoOperation op = tenant.CreateSite(newSite); clientContext.Load(op, i => i.IsComplete); clientContext.ExecuteQuery(); } |
|
You need to ensure that you have the used template as supported template for the chosen "tenant admin site". By default code is using the root site of the web application as the admin site and if the root site is publishing site, oob team site is not available as template, which will cause this exception. You can control the supported sites by going to the tenant admin site and add oob team site as the supported sub site template for it. This will ensure that the team site is also supported for new site collections. |
Microsoft.Online.SharePoint.Client.Tenant.dll for on-prem (15 version)
included in the assemblies folder.