When to Create Project Types

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at When to Create Project Types.

Creating a new project type provides a basis for customizing Visual Studio for your users. However, creating a new project type is not required for all Visual Studio customizations. The following guidelines should help you determine whether a new project type is required for your scenario.

You must create a project type if you want to customize Visual Studio to act in one or more of the following ways:

  • Participate in build, deploy, configurations, and source control.

  • Offer debugging support.

  • Display project items in Solution Explorer.

  • Use the Open Project or New Project dialog box.

  • Support project nesting.

You might want to create a new project type that can use Visual Studio in the following ways to modify or extend the behavior of an existing project type, for example, modifying the build process for Visual C++ projects:

  • Work with multiple files as a single unit.

  • Display a single file as a hierarchy of sub-items.

  • Display a command context around editors.

  • Display a service context for editors.

Creating a new project is sometimes not necessary. The following table shows the tasks that you do not have to create a project type for.

TaskDescription
Handling commandsAny VSPackage can handle commands.
Building an editorCustom editors can be registered. For more information, see Document Windows and Editors.
Owning windowsYou can create both tool and document windows without adding a new project type.
Exposing properties in the Properties windowAll objects can expose properties.

You can use project subtypes to extend a managed project type without having to create a new project type. Project subtypes use COM aggregation to extend managed projects written in Microsoft Visual Basic or Visual C#. With COM aggregation, you can reuse much of the managed project system implementation and still customize for a particular scenario through aggregation and the use of supporting interfaces. For more information about project subtypes, see Project Subtypes.

Document Windows and Editors
Checklist: Creating New Project Types
Hierarchies in Visual Studio

Show: