SubPointSolutions / spmeta2

SharePoint artifact provision for .NET platform. Supports SharePoint Online, SharePoint 2019, 2016 and 2013 via CSOM/SSOM.
http://subpointsolutions.com/spmeta2
133 stars 56 forks source link

SP2016 CSOM - taxonomy group cannot be found after provision #1103

Closed SubPointSupport closed 6 years ago

SubPointSupport commented 6 years ago

Brief description

SPMeta2 cannot find taxonomy group provisioned with CSOM againt SharePoint 2016. There seems to be some kind of delay after which taxonomy group becomes "availbable".

This is a known issue, we had it reporrted and fixed for SharePoint Online eatly on:

Apparantly, SharePoint 2016 has got the same regression. We need to put a fix in place that try-retry happens for SharePoint 2016 as well.

The following code needs to be updated:

DefaultClientRuntimeContextService protected virtual bool DetectSharePointOnlineContext(ClientRuntimeContext context)

With SharePoint 2016, hoverwer, it becomes rather schallanging - we should also check client context ServerLibraryVersion = {16.0.7324.1200} or ServerVersion {16.0.7324.1200} to ensure that SPMeta2 makes try-retry/wait logic for this specific case.

Currently, only context assembly version is checked. That works well for application compiled with the recent, correct CSOM version and won't work in CSOM 2013 talking to O365/SharePoint 2016 scenario.

SharePoint API

SPMeta2 API

Any model with taxonomy group involved.

SPMeta2.Exceptions.SPMeta2ModelDeploymentException: There was an error while provisioning definition. Check ModelNode prop. ---> SPMeta2.Exceptions.SPMeta2Exception: Cannot find a taxonomy group after provision at SPMeta2.CSOM.Standard.ModelHandlers.Taxonomy.TaxonomyGroupModelHandler.WithResolvingModelHost(ModelHostResolveContext modelHostContext) at SPMeta2.Services.Impl.DefaultModelTreeTraverseService.Traverse(Object modelHost, ModelNode modelNode)