SharePoint 2010 ECM Code Sample: Generate Managed Metadata Hierarchy

Use this SharePoint 2010 code sample to generate the path of the taxonomy from a specified term up to its parent.

Applies to: SharePoint Server 2010

The Generate Managed Metadata Hierarchy code sample is located in the file in the path C:\Program Files\Microsoft SDKs\SharePoint 2010\Samples, and demonstrates how to generate a managed metadata hierarchy.

Download the SharePoint 2010 sample code described in this topic from Code Gallery.

Building and Running the Generate Managed Metadata Hierarchy Sample

Test this project on your development site or test site.

Building the Sample

  1. In Microsoft Visual Studio 2010, open the *.sln file.

  2. On the Properties pane, change the Site URL value to be the absolute address of your development test site. For example, http://MyDevServer/. Ensure that you include the closing forward slash.

Running the Sample

This code sample generates the taxonomy path for a term up to the parent. It is based on getting the property from a field that is set on a document set, but you can use it for other scenarios.


The sample assumes that the hierarchy is no more than 10 terms deep and that the term is used only in one term set.

See Also


SharePoint 2010 ECM Code Sample: Managing Managed Metadata Dependencies

Managing Enterprise Metadata in SharePoint Server 2010 (ECM)

Metadata and Taxonomy Programming Model in SharePoint Server 2010 (ECM)

Other Resources

Enterprise Content Management Resource Center

SharePoint Developer Center

SharePoint Developer Team Blog