Customize Database Build and Deployment by Using Build and Deployment Contributors
Visual Studio provides extensibility points that you can use to modify the behavior of the build and deployment actions for database projects. These extension points are defined in such a way that they can apply to any database schema provider (DSP) implementation.
You can create an extension for the extensibility points, as shown in the following table:
This type of extension is executed when the database project is built after the project model has been completely validated. The build contributor can access the completed model, in addition to all properties of the Build task and any custom arguments.
This type of extension is executed when the database project is deployed, as part of the deployment pipeline, after the deployment plan has been generated, but before the deployment plan is executed. You can use a DeploymentPlanModifier to modify the deployment plan by adding or removing steps. Deployment contributors can access the deployment plan, the comparison results, and the source and target models.
This type of extension is executed when the deployment plan is executed and provides read-only access to the deployment plan. The DeploymentPlanExectutor performs actions based on the deployment plan.
Supported Extensibility Scenarios
You can implement build or deployment contributors to enable the following example scenarios:
In addition, you can expose customized pairs of name/value arguments from your contributor that are written to the database project file. You can use these arguments to enable the contributor to extract information from MSBuild or to enable the end user of your contributor to customize the behavior. For example, you could allow users to specify the name of an input or output file.
Learn more about the extensibility points: You can read about the base classes that you use to implement build and deployment contributors.
Create sample contributors: Learn the steps that are required to create a build or deployment contributor. If you follow these walkthroughs, you will:
You can create all your contributors in a single assembly or among several assemblies, depending on how you want the contributors distributed to your team.
Distribute build and deployment contributors to team members: After you verify that your contributors work correctly, you can distribute them to your team. You can ask each team member to install and register the feature extension manually, or you can create a simple installation program for it.