ContentTypePublisher.Publish Method
Publishes a content type on the specified hub site.
Namespace: Microsoft.SharePoint.Taxonomy.ContentTypeSync
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Sub Publish ( _
contentType As SPContentType _
)
'Usage
Dim instance As ContentTypePublisher
Dim contentType As SPContentType
instance.Publish(contentType)
public void Publish(
SPContentType contentType
)
Parameters
contentType
Type: Microsoft.SharePoint.SPContentTypeThe content type to be published. The content type should be on the root Web of the hub site.
Exceptions
Exception | Condition |
---|---|
UnauthorizedAccessException | The user must have rights to add or customize pages to be able to perform this operation. |
ContentTypeSyndicationException | The content type fails to be published onto one or more associated service applications. Or the content type or one of its dependent content types contains a managed metadata field that uses a customized term set that is not available outside of the current site collection. |
Remarks
If there are multiple service applications associated with the current hub site and one or more are using the current site as the hub, the content type is published to all of the associated service applications.