Archive

Archive for March, 2011

Adding a Content Type to a Hub Using a Feature

March 25th, 2011 2 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: