Extending SharePoint Projects
Create a project extension when you want to customize project-level features of SharePoint projects. For example, you can add custom project properties, or respond to project-level events that are raised when the user develops a SharePoint solution in Visual Studio.
When you create a project extension, you can also add the following functionality to the SharePoint projects:
Add a shortcut menu item. The menu item appears when you right-click a SharePoint project node in Solution Explorer. For more information, see How to: Add a Shortcut Menu Item to SharePoint Projects.
Add a custom property. The property appears in the Properties window when you select a SharePoint project in Solution Explorer. For more information, see How to: Add a Property to SharePoint Projects.
For a walkthrough that demonstrates how to create, deploy, and test a project extension, see Walkthrough: Creating a SharePoint Project Extension.
When you create a project extension, the extension loads when any kind of SharePoint project is opened in Visual Studio. Visual Studio includes several SharePoint project templates, such as list definitions, content types, and event receivers. However, there is only one SharePoint project type. The project types that appear in the New Project dialog box are only templates that bundle together one or more SharePoint project items. Because there is only one SharePoint project type, extensions created for one project apply to all SharePoint projects. You cannot, for example, create an extension that applies to only a Content Type project.
To access a specific project instance, handle one of the ISharePointProjectEvents events of the projectService parameter in your implementation of the ISharePointProjectExtension.Initialize method. For example, to determine when a SharePoint project is added to a solution, handle the ProjectAdded event. For more information, see How to: Create a SharePoint Project Extension.