I’ve been looking around the new project system introduced in the BizTalk Server 2009 beta. As you might have heard before, it’s now based on MSBuild. This is an extremely welcome change from the obscure compilation model in previous BizTalk versions that caused so much frustration.

BizTalk Projects now look much like regular C# projects (they even have the same icon in solution explorer) but they can contain BizTalk artifacts like schemas, orchestrations, maps and pipelines.

Opening up the .btproj file reveals some of the differences and custom MSBuild tasks used by the new BizTalk project system. Two things are initially important to mark an MSBuild file as a BizTalk project.

The first one is the value:

<ProjectTypeGuids>{EF7E3281-CD33-11D4-8326-00C04FA0CE8D};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}

This means:

  • {EF7E3281-CD33-11D4-8326-00C04FA0CE8D}: This represents the BizTalk project factory, and tells VS where to find the item templates for BizTalk artifacts and so on.
  • {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}: This represents the C# project system.

So, in fact, a BizTalk Project is a C# project. Right now you can’t add C# artifacts to the project without editing the .btproj file by hand, but one can hope this will be supported in upcoming builds.

The second part important to making a .btproj is importing the BizTalk MSBuild tasks, which is accomplished by this line:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\BizTalk\BizTalkC.targets" />

If we look at the BizTalkC.targets file, we can see that the BizTalk MSBuild tasks are implemented in the Microsoft.VisualStudio.BizTalkProject.BuildTasks assembly, which you'll find in your 'Microsoft BizTalk Server 2009\Developer Tools' folder.


Global Project Properties

There are several properties that will get set in the project files depending on your project settings that are BizTalk-specific:

  • : This is a Boolean (true, false) property that indicates if the generated assembly should be marked as BPEL compliant (I think).
  • : Corresponds to the Enable Unit Testing option in the Deployment tab of the project settings dialog, and controls whether the unit testing features for pipelines, schemas and maps are enabled.

Other settings are per-user settings and stored in the .btproj.user file:

  • : The name of the SQL Server instance that has the BizTalk databases for deployment.
  • : The name of the BizTalkMgmt database.
  • : The name of the BizTalk application you want to deploy to.
  • : Boolean property that indicates if you want to allow redeployments from within Visual Studio.
  • : If true, the BizTalk hosts will be restarted after each deployment.
  • : If true, the generated assembly will be registered in the Global Assembly Cache (GAC).

Per-File Project Properties

The per-user project file (.btproj.user) can also include a bunch of item-specific properties, which are visible when you select a file in Solution Explorer and open the Properties window.

In this category you’ll find properties for setting paths for map input and output files for testing/debugging as well as paths for input and output files for testing schemas.

Here’s an example:

<File Path="E:\Projects\BizTalk\PipelineTesting\SampleSchemas\Map1.btm">
   <ValidateTestMapInput>True
   <ValidateTestMapOutput>True
   <TestMapInputInstanceFilename>
   <TestMapOutputInstanceFilename>
   <TestMapSourceType>0
   <TestMapTargetType>0
   <EditorOutputInstanceFilename>
   <EditorInputInstanceFilename>
   <GenerateInstanceOutputType>0
   <ValidateInstanceInputType>0
   <PropertySchemaFileName>PropertySchema.xsd
   <AutoRefreshSchema>0

<File Path="E:\Projects\BizTalk\PipelineTesting\SampleSchemas\NoNS.xsd">
   <ValidateTestMapInput>True
   <ValidateTestMapOutput>True
   <TestMapInputInstanceFilename>
   <TestMapOutputInstanceFilename> >
   <TestMapSourceType>0
   <TestMapTargetType>0
   <EditorOutputInstanceFilename>
   <EditorInputInstanceFilename>
   <GenerateInstanceOutputType>0
   <ValidateInstanceInputType>0
   <PropertySchemaFileName>PropertySchema.xsd
   <AutoRefreshSchema>0

Building Pipelines

To build a pipeline, you can use the PipelineCompilerTask:

<ItemGroup>
   <Pipeline Include="CSV_FF_RecvPipeline.btp">
      <Namespace>SampleSchemas
      <TypeName>CSV_FF_RecvPipeline
  

Building Schemas

BizTalk Schemas can be compiled using the new SchemaCompiler task:

<ItemGroup>
   <Schema Include="Schema1_NPP.xsd">
      <Namespace>SampleSchemas
      <TypeName>Schema1_NPP
  

Building Maps

BizTalk Maps can be compiled using the new MapperCompiler task:

<ItemGroup>
   <Map Include="Map1.btm">
      <TypeName>Map1
      <Namespace>SampleSchemas
      <SubType>Task
  

I'm not sure yet what the element does.


Building Orchestrations

BizTalk Orchestrations can be built with the new XLangTask:

<ItemGroup>
   <XLang Include="BizTalk Orchestration1.odx">
      <TypeName>BizTalk_Orchestration1
      <Namespace>SampleSchemas
      <SubType>Task
  

<ItemGroup>


Tomas Restrepo

Software developer located in Colombia. Sr. PFE at Microsoft.