Project File Structure

Parent Previous Next

Just like BizTalk (.btproj), C# (.csproj) or VB.NET (.vbproj) projects, the Deployment Framework for BizTalk is based around a project file in MSBuild XML format.  A Deployment Framework for BizTalk project file carries a .btdfproj extension and can be edited with any text or XML editor.


TIP: Use the Visual Studio XML editor to edit your .btdfproj files, because the Deployment Framework's extensions to IntelliSense will guide you as you edit the file.


Let’s look at the structure of the XML in the project file.  The project always declares a single <Project> element, and within it is found, in order, the following elements:


The property groups (one or more <PropertyGroup> elements) define simple MSBuild properties.  A property is defined like this:


<PropertyGroup>

 <MyPropertyName>MyPropertyValue</MyPropertyName>

</PropertyGroup>


One property group may contain any number of property declarations.


Entire property groups may be made conditional on MSBuild properties.  For example, to include a property group only during a debug build:


<PropertyGroup Condition="'$(Configuration)' == 'Debug'">

</PropertyGroup>


The text $(Configuration) is a property reference.  MSBuild replaces it with the value of the property at runtime.


Item groups (one or more <ItemGroup> elements) define MSBuild items, which are typically used for variable-length lists of items.  Each item in an item group may also contain zero or more metadata elements.  In the following example, the Orchestrations item group has a metadata element LocationPath:


<ItemGroup>

 <Orchestrations Include="MyOrchestrations.dll">

   <LocationPath>..\Orchestrations\bin\$(Configuration)</LocationPath>

 </Orchestrations>

</ItemGroup>


As with property groups, item groups may also be conditional on MSBuild properties:


<ItemGroup Condition="'$(Configuration)' == 'Debug'">

</ItemGroup>


After the property and item group definitions, you must include an <Import> element that brings in the Deployment Framework’s own MSBuild property, item and target definitions.  This is already part of the default project file created by the Add New Project wizard.


<Import Project="$(DeploymentFrameworkTargetsPath)BizTalkDeploymentFramework.targets" />


The final section of the project file may contain zero or more MSBuild target definitions (<Target> elements).  These are like subroutines that the MSBuild engine can execute.  In many cases you will not need to include any targets, but if you need to do some custom work that is not handled by the Deployment Framework out of the box, this is where you can do it.  This is an example of overriding one of the targets pre-defined by the Deployment Framework:


<Target Name="CustomDeployTarget">

</Target>


Everything that has been discussed in this section is standard MSBuild syntax.  For more information, including how to implement your own custom targets, please see the MSDN documentation or the many online and print resources for MSBuild.


Created with the Personal Edition of HelpNDoc: Full-featured Help generator