Home > SharePoint 2010 > Adding a Content Type to a Hub Using a Feature

Adding a Content Type to a Hub Using a Feature

March 25th, 2011 Leave a comment Go to comments

The more I work with content types , the more I like to do everything programmatically rather than declaratively using features. Here is a funny thing that may make you scratch your head for a while:

  1. Create a feature that adds a content type to a content type hub.
  2. Publish the content type in the hub.
  3. Let the publishing/subscribe timer jobs run (every hour or so) or manually execute them through Central Admin site.
  4. In a subscribe site collection, check the content type publishing error log.

It errors out saying that you need to install the feature on the subscriber site collection. Although, you don’t need to activate the feature on the target subscriber , I still think the dependency on feature installation on the subscriber site collection is somehow odd!

Whether this is by design or just a bug , I don’t know, but here is the resolution :

Resolution: Add the content type to the hub either through the browser, PowerShell or use a console application for what that matters!Using features to add content types is really not worth the headache.

Categories: SharePoint 2010 Tags:
  1. Daniel
    September 18th, 2012 at 15:59 | #1

    hello Reza, I added my content types declarativly on the site collection and activated the content type syndication hub manually, but how to i publish the content types programmatically as they are a lot of content types?