I am trying to update properties of a hubsite after I create it.

Step 1: create the hubsite as a normal site

Step 2: register it as hubsite using tenant.RegisterHubSiteWithCreationInformation()

Code : var hubsiteCreationInfo = new HubSiteCreationInformation() {
LogoUrl = "logoUrl", EnablePermissionsSync = false, Description = "description", Title = "Sample Hub", SiteUrl = "ContextUrl" }; tenant.RegisterHubSiteWithCreationInformation(hubsiteCreationInfo.SiteUrl, hubsiteCreationInfo); await adminCsomRoot.ExecuteQueryAsync();

Error/exception: The list item could not be added or updated because duplicate values were found in the following field(s) in the list: [HubSite, Site].

Do we have a way of creating and THEN updating properties of a Hubsite. or we only can create it along with the properties provided? Namewise RegisterHubSiteWithCreationInformation seems like a method we should be able to use after creation; similar to RegisterHubSite(which works fine in the above case)

1 Answer 1


This method is used to create a new site as a hub site. For existing one you should use RegisterHubSite(url) method.

Use this link for the reference (line 640): ObjectHierarchySequenceSites.cs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.