Configurable Deployment in Visual Studio .NET

Encode QR Code ISO/IEC18004 in Visual Studio .NET Configurable Deployment
Configurable Deployment
QR Code 2d Barcode Drawer In VS .NET
Using Barcode maker for Visual Studio .NET Control to generate, create Denso QR Bar Code image in Visual Studio .NET applications.
Figure 11-34: VSIX manifest designer
Decode QR Code In VS .NET
Using Barcode recognizer for .NET Control to read, scan read, scan image in .NET applications.
Figure 11-35: Add Content dialog
Draw Bar Code In Visual Studio .NET
Using Barcode creation for VS .NET Control to generate, create barcode image in Visual Studio .NET applications.
11: Packaging and Deployment
Scanning Bar Code In VS .NET
Using Barcode decoder for Visual Studio .NET Control to read, scan read, scan image in .NET framework applications.
Figure 11-36: Installing custom deployment step
QR-Code Maker In Visual C#
Using Barcode generation for .NET framework Control to generate, create QR Code image in .NET framework applications.
Figure 11-37: Installation Completed
Print QR In VS .NET
Using Barcode maker for ASP.NET Control to generate, create QR Code image in ASP.NET applications.
We can now open Visual Studio to verify the custom step was installed Let s just create an empty project with the sandboxed solution trust level To verify our custom step was successfully installed we should open the SharePoint property page Right click the project name and select Properties from the context menu Click the SharePoint tab to open the SharePoint property page We are going to create a new deployment configuration that will use our custom step Click the New button and the Add New Deployment Configuration dialog as shown in Figure 11-38 opens
QR Code JIS X 0510 Generator In VB.NET
Using Barcode printer for .NET Control to generate, create QR Code JIS X 0510 image in Visual Studio .NET applications.
Configurable Deployment
Drawing European Article Number 13 In VS .NET
Using Barcode drawer for VS .NET Control to generate, create GTIN - 13 image in VS .NET applications.
Figure 11-38: The Add New Deployment configuration with custom step Create Backup installed
Generate Barcode In .NET
Using Barcode generator for VS .NET Control to generate, create bar code image in VS .NET applications.
Notice that our custom Create Backup step we created is installed and it shows in the list of available deployment and retraction steps Double click the step name and add it to the selected deployment steps Click OK to close the dialog and set the deployment configuration you just created as the active one Next, right click the project name and click Deploy to deploy the project What happens is exactly what we wanted to happen the project we created is a sandboxed project therefore we are getting the error we implemented in the Error List as shown in Figure 11-39
Code-128 Generator In .NET Framework
Using Barcode printer for Visual Studio .NET Control to generate, create ANSI/AIM Code 128 image in Visual Studio .NET applications.
11: Packaging and Deployment
Code 39 Generator In Visual Studio .NET
Using Barcode creator for .NET Control to generate, create Code-39 image in .NET framework applications.
Figure 11-39: Error using custom deployment step
Monarch Creation In VS .NET
Using Barcode maker for .NET framework Control to generate, create NW-7 image in Visual Studio .NET applications.
Our information is displayed to the Output window as well The text below is displayed in the Output window when we try to deploy the sandboxed solution that uses our custom step
Drawing Bar Code In VB.NET
Using Barcode creator for .NET Control to generate, create barcode image in .NET framework applications.
  
Creating Bar Code In Java
Using Barcode creation for Java Control to generate, create barcode image in Java applications.
Let s change the solution to a farm solution To do so, select the project node in the Solution Explorer and change the Sandboxed Solution property in the Properties window to False Try re-deploying the project This time the custom step executes successfully and copies the WSP file to the location we specified in our code (C:\Backups) The text in the Output window is shown below:
Drawing Bar Code In .NET
Using Barcode maker for ASP.NET Control to generate, create bar code image in ASP.NET applications.
 
ECC200 Generation In Visual Basic .NET
Using Barcode generation for Visual Studio .NET Control to generate, create Data Matrix 2d barcode image in .NET applications.
Even though the custom step was installed and we are able to use it, we still had to manually create a new deployment configuration If we ship the custom deployment step as it is right now the developers would still need to create the deployment configuration that uses this step What
Recognize Barcode In VS .NET
Using Barcode recognizer for .NET Control to read, scan read, scan image in VS .NET applications.
Configurable Deployment
Code 3/9 Creation In C#.NET
Using Barcode creation for .NET Control to generate, create Code 39 Extended image in Visual Studio .NET applications.
would be really nice is if we could install the extension and a custom deployment configuration that used it as well We can do that as well We can create our own custom deployment configuration from code Once we have that we can deploy both the extension and the deployment configuration and ensure that all users are using the same configuration Just like with the custom deployment step, to create a custom deployment configuration we have to create a new class, add an attribute, and inherit from an interface called ISharePointProjectExtension Open the DeploymentStepExtension project and add a new class to the project Name the class MyDeploymentConfiguration Open the class file once it s created and add the following using statements at the top of the file:
Recognize EAN-13 Supplement 5 In .NET Framework
Using Barcode reader for .NET framework Control to read, scan read, scan image in VS .NET applications.
           
Barcode Reader In Java
Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications.
The newly created deployment configuration class has to inherit from the ISharePointProjectExtension interface Type :ISharePointProjectExtension right after the class name and then click the IntelliSense menu that is displayed under the interface name and click the Implement interface ISharePointProjectExtension to implement the interface as shown in Figure 11-40
Figure 11-40: Implementing interfaces
We should also make this class discoverable by adding the Export attribute just as we did with the custom deployment step The MyDeploymentConfiguration class with implemented interface and Export attribute is shown in Listing 11-16
11: Packaging and Deployment
Listing 11-16: MyDeploymentConfigurationcs
            
The projectService parameter that is passed to the Initialize method has properties, methods, and events we can use to extend the SharePoint project and create the new deployment step What we want to achieve is to have the custom deployment configuration available as soon as a SharePoint project is created We can use the ProjectInitialized event to do that First, let s remove the exception code from the Initialize method and hook up the ProjectInitialized handler by adding the following line to the Initialize method:
      
In the ProjectInitialized method handler we will create a custom deployment configuration The SharePointProjectEventArgs parameter passed to the event handler method exposes the Project instance in which we can access the DeploymentConfigurations collection and add a new deployment configuration to the collection What we need to pass to the Add method of the DeploymentConfigurations collection is the name of the deployment configuration as well as the list of deployment step IDs and retraction step IDs Let s decide that for our custom configuration we are going to use the same order of deployment and retraction steps as the default configuration does The only difference in our custom deployment configuration will be our custom CreateBackup step, which is going to be executed as the last in the list of deployment steps Add the code in Listing 11-17 to the projectService_ProjectInitialized method to create the list of deployment and retraction steps and a custom deployment configuration