The build process of an Integration Package (part I)
This series of posts describe the inner workings of how a package is build with focus on the VSCT file. In this part we’ll ravel out the parts of the build process.
When building a package in Visual Studio, the project file is used as an input on which items to include in the build. When you open up a csproj file of a integration package project (unload the project and open for edit) you can find next items which are related to the package type project:
- EmbeddedResource Include=”VSPackage.resx” with children MergeWithCTO and ManifestResourceName
- None Include=”source.extension.vsixmanifest” with child SubType Designer
- VSCTCompile Include”xxx.vsct” with children ResourceName and SubType Designer
- A PropertyGroup with children TargetRegistryRoot, RegisterOutputPackage and RegisterWithCodebase
- An Import tag with attribute Project=”…Microsoft.VsSDK.Targets”
- It is actually very simple to find out which items belong to the VSX since they are not included in the schema (http://schemas.microsoft.com/developer/msbuild/2003) and therefore are indicated as invalid.
- The VSPackage.resx is a resource for the package
The source.extension.vsixmanifest is the designer for the VSIX manifest, it declares what type of extensions are provided by the content in the VSIX. For more info about VSIX files see Quan To’s post on VSIX.
The VSCT file is the source for the command table (see further). The <SubType>Designer</Subtype> on the vsct file tells VS to show a View Code/View Designer group in the context menu. In both cases it opens up a xml designer.
The PropertyGroup are options of the VSIX build process and can be found in the property page of the project in the VSIX tab.
All the previous items are used during the build process. This process is declared in the import tag pointing to a build targets file : “$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets”. This file can be found typically in the “C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\VSSDK” folder. When you open this folder you can find the Microsoft.VsSDK.targets, Microsoft.VsSDK.Common.targets files and an assembly Microsoft.VsSDK.Build.Tasks. These are the key players of the build process.
If we take a look at the tasks, we could categorize them as in beneath image:
- Check On VsSDK installation: checks if VsSDK is installed
- Compile VSCT: compiles the VSCT file into a CTO file (command table)
- Deploy VSIX: prepares for the deployment of the package
- Merge CTO resource: check on resources (like MenuResource) to merge into the cto file
- Generate Code from LEX/YACC files: the language token and lexical classes used to enable syntax coloring (see Babel)
- Generate PkgDef file: generates the package definition file which represents registry values that are created when an application is installed on a computer and that are referenced by the Visual Studio Shell when it starts the application.
- Generate Zip file: generates the Zip file to be deployed
In next post we’ll take a closer look at the tasks related to the VSCT file.
Recent Comments