DefaultSiteCollectionTermStore == null

Between writing the previous post about provisioning Managed Metadata fields declaratively we decided to remove the hard-coded term store name shown below

var termStore = session.TermStores["Managed Metadata Service"];

and replace it with

TermStore termStore = session.DefaultSiteCollectionTermStore;

We found that while the solution worked locally when we deployed the feature to the SharePoint 2010 UAT server it didn’t work. Turns out that the DefaultSiteCollectionTermStore was null.

After much scratching of heads we narrowed the issue down the way the Managed Metadata Service Proxy had been set up during the installation of the UAT SharePoint server. The IT team responsible for building the UAT servers used PowerShell to automate the building of the server. For the Managed Metadata Service this had a particular impact.

If you highlight the Managed Metadata Service Connection in Central Administration, then click Properties as shown below:

image

you will see the properties available…

image

On our development PCs, which had been setup using the Configuration Wizard, all of the available check boxes above were ticked. On the UAT server the opposite was true. Dutifully we ticked all the boxes, hit OK and tried again. Still no joy, so we set up another site collection and activated the feature. This time the feature worked as expected.

Activating the default storage location for keywords and column specific term sets only works for site collections created after the options have been selected (no surprise). At this point we haven’t been able to work out how to associate the default storage with an existing site collection and the easiest option was to delete the site collection, set up a new one and activate the required features.

4 Replies to “DefaultSiteCollectionTermStore == null”

  1. Hi and thanks for the information. I´m wondering if you have any info on how to use this on local site collections term sets? I don´t want to create Groups in the MMS accessed from CA but rather just create it in the site collection. This can be done via the UI when creating a new Managed Metadata column but I can not see any methods in the API to accomplish this in the API. Regards, // Henrik

  2. To get it working on an existing site, what I had to do was to Check off the Managed Metadata service checkboxes, and restart the server (probably restarting the Managed Metadata service would have done the same job, but I restarted the server just in case). After restarting the server I was able to access the DefaultSiteCollectionTermStore.

Comments are closed.