Share via


Using the Managed Package Framework to Implement a Project Type (C#)

The Managed Package Framework (MPF) provides C# classes you can use or inherit from to implement your own project types. The MPF implements many of the interfaces Visual Basic 2008 expects a project type to provide, leaving you free to concentrate on implementing the particulars of your project type.

Using the MPF Project Source Code

Unlike other classes in the MPF, the project classes are not included in the assemblies shipped with Visual Basic 2008. Instead, the project classes are provided in source-code form so that Visual Studio SDK functionality for the current release of Visual Basic 2008 can continue to be enhanced without waiting for the next release of Visual Basic 2008.

The C# source files are installed by default to <Visual Studio SDK installation path>\VisualStudioIntegration\Common\Source\CSharp\Project.

Note

Reference documentation for the MPF project classes indicates that they are included in the MPF.Project.NonShipping assembly. As its name suggests, that assembly does not ship with the Visual Studio SDK. Nevertheless, the compilation process for the documentation required the assembly, and the appearance of its name in the documentation is an artifact of the compilation.

The project classes are designed to be imported into the package that implements your project type, rather than to be compiled into their own assembly. You can add them to your project by hand, but to simplify the experience, the Visual Studio SDK includes an MSBuild project file that adds the necessary assembly, COM-object references, and project class source files as a group. To use this MSBuild project file, you must open your project type's project file (.csproj, for example) as text and add the following elements:

<PropertyGroup>
  <ProjectBasePath>PathToProjectClasses</ProjectBasePath>
</PropertyGroup>
<!-- This imports the files that make up the project base classes. -->
<Import Project="$(ProjectBasePath)\ProjectBase.Files" />

where PathToProjectClasses is <Visual Studio SDK installation path>\VisualStudioIntegration\Common\Source\CSharp\Project\ or the equivalent directory on your system.

For an example of using ProjectBase.Files project to import the MPF project classes, see the IronPython Project System Sample at <Visual Studio SDK installation path>\VisualStudioIntegration\Samples\IronPythonIntegration\Project\PythonProject.csproj.

Hierarchy Classes

The following table summarizes the classes in the MPF that support project hierarchies. For more information, see Hierarchies and Selection.

Class name

HierarchyNode

ProjectNode

ProjectContainerNode

FileNode

FolderNode

ReferenceContainerNode

ReferenceNode

ProjectReferenceNode

ComReferenceNode

AssemblyReferenceNode

BuildDependency

Document-Handling Classes

The following table lists the classes in the MPF that support document handling. For more information, see Opening and Saving Project Items.

Class name

DocumentManager

FileDocumentManager

Configuration and Output Classes

The following table lists the classes in the MPF that let project types support multiple configurations, such as debug and release, and collections of project output. For more information, see Managing Configuration Options.

Class name

ConfigProvider

ProjectConfig

BuildableProjectConfig

OutputGroup

ProjectElement

Automation-Support Classes

The following table lists the classes in the MPF that support automation so that users of your project type can write macros and add-ins.

Class name

OAProject

OANavigableProjectItems

OAProjectItems

OAProjectItem

OANestedProjectItem

Properties Classes

The following table lists the classes in the MPF that let project types add properties that users can browse and modify in a property browser.

Class name

LocalizableProperties

NodeProperties

FileNodeProperties

ProjectNodeProperties

FolderNodeProperties

ReferenceNodeProperties

See Also

Other Resources

IronPython Project System Sample