This documentation is archived and is not being maintained.

IPersistXMLFragment Interface

Used to persist non-build related data in free-form XML.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in microsoft.visualstudio.shell.interop.8.0.dll)

[GuidAttribute("6B0C8632-6F01-4E54-9645-FFE82A2F4FE9")] 
[InterfaceTypeAttribute(1)] 
public interface IPersistXMLFragment
/** @attribute GuidAttribute("6B0C8632-6F01-4E54-9645-FFE82A2F4FE9") */ 
/** @attribute InterfaceTypeAttribute(1) */ 
public interface IPersistXMLFragment
GuidAttribute("6B0C8632-6F01-4E54-9645-FFE82A2F4FE9") 
InterfaceTypeAttribute(1) 
public interface IPersistXMLFragment

IPersistXMLFragment can be implemented on both the main project subtype aggregator object and the project subtype configuration objects. The base project calls the main project subtype aggregator object to load or save configuration independent data. The base project can also call on the project subtype configuration objects to load or save configuration dependent data.

Base project calls IPersistXMLFragment methods for each aggregation level by passing the GUID for each level. The base project then passes or receives the XML fragment dedicated for the particular project subtype. In a common case the project subtype implementation intercepts its own GUID after the base project passes it, and handles the call and forwards all other calls to inner project subtypes (with their particular GUIDs). The project subtype may also decide to modify the data it passes to the inner subtypes before or after the call to IPersistXMLFragment.

The base project maintains a collection of XML nodes attributed with the project subtype GUID and configuration type under the ProjectExtensions \ VisualStudio node in the Microsoft Build Engine (MSBuild) XML tree.

An example of XML data dedicated for a particular project subtype can be similar to the example scenario below.

<ProjectExtensions>

  <VisualStudio>

    <FlavorData= "GUID_Flavor">

      {Flavor debug data}

    </FlavorData>

  </VisualStudio>

</ProjectExtensions>

Notes to Implementers Implement IPersistXMLFragment to enable the persistence of non-build related data in the project files by project subtypes.

Show: