Take the 2-minute tour ×

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

1 Answer 1

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


