SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created managed metadata Group named "MyGroup" in term store (Managed Metadata Service) programmatically under FeatureActivated method in SharePoint 2013 as below:

     public override void FeatureActivated(SPFeatureReceiverProperties properties)

        Guid fieldID1 = new Guid("{e7344bac-ce09-4254-96eb-387aa0635bd4}");
        SPSite site = properties.Feature.Parent as SPSite;
        TaxonomySession session = new TaxonomySession(site);
        var termStore = session.TermStores["Managed Metadata Service"]; 

            var group = termStore.CreateGroup("MyGroup");
            SPField field1 = site.RootWeb.Fields[fieldID1];
            var termSet1 = group.CreateTermSet(field1.InternalName);
    // Connect to MMS
  TaxonomyField taxonomyField1 = site.RootWeb.Fields[fieldID1] as TaxonomyField;
     taxonomyField1.SspId = termSet1.TermStore.Id;
                            taxonomyField1.TermSetId = termSet1.Id;
                            taxonomyField1.TargetTemplate = string.Empty;
                            taxonomyField1.AnchorId = Guid.Empty;

Code successfully executed but I don't see "MyGroup" under site settings->Term store management. Why its not there ?

share|improve this question
up vote 0 down vote accepted

I think you are missing the CommitAll() after you make the changes to the termstore.

var termSet1 = group.CreateTermSet(field1.InternalName);

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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