Thursday, April 13, 2006

 

Automatic Deployment in BizTalk 2006

During my recent BizTalk 2004 projects I have been continuously using Scott Colestock’s excellent Deployment Framework for BizTalk 2004. On my first BizTalk 2006 project I thought that the migration of the tools and scripts will be quite smooth. This is when things start to go wrong :)

When executing the “debugDeploy” target you might get the following error:

BUILD FAILED

INTERNAL ERROR

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: File or assembly name Microsoft.BizTalk.ExplorerOM, or one of its dependencies, was not found.
File name: "Microsoft.BizTalk.ExplorerOM"
   at BizTalk.NAnt.Tasks.ControlOrchestrations..ctor()

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.BizTalk.ExplorerOM, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = C:\Develop\Projects\My.BizTalk.Project\DeployTools\NAntSubset\
LOG: Initial PrivatePath = NULL
Calling assembly : BizTalk.NAnt.Tasks, Version=1.0.0.5, Culture=neutral, PublicKeyToken=null.


The reason for that is the Microsoft.BizTalk.ExplorerOM.dll which is extensively used by the deployment framework to manage orchestrations. Disassembling the BizTalk.Nant.Tasks.dll assembly you will find out that it references version 3.0.1.0 of the Microsoft.BizTalk.ExplorerOM.dll which makes sense with the BizTalk 2004 release. When checking what is the version of the same assembly in BizTalk 2006 you will be stuck with the same version. Though the file size and the contents (apparently) have changed and breaking changes have been introduced. Heard of dll hell?!

What I did in order to make the deployment framework work with the BizTalk Server 2006 release and the .NET framework 2.0 was the following:

  1. Get the latest nightly release of NAnt. As of writing the post there is no a stable release that supports the .NET Framework 2.0. I have used nant-0.85-nightly-2006-04-08. Rebuild the NAnt solution;

  2. Copy the newly built NAnt files to the %BizTakl2006_solution_directory%\DeployTools\NantSubset directory;

  3. Get the latest release of the Deployment Framework for BizTalk 2004 from here. As of writing the post there is no release that supports BizTalk Server 2006;

  4. Rebuild the BizTalk.Nant.Tasks project, changing the referenced Microsoft.BizTalk.Explorer.OM.dll to the assembly in the “%BizTalk_2006_Install_dir%\Developer tools”. By default, it is C:\Program Files\Microsoft BizTalk Server 2006\Developer Tools;

  5. Copy the newly built BizTalk.Nant.Tasks.dll in the %BizTakl2006_solution_directory%\DeployTools\NantSubset directory;

  6. Retry the “debugDeploy” or any other task that might be used during development. Everything works!

As a conclusion I recommend the Deployment Framework for BizTalk 2004 for the automation of the deployment process in BizTalk solutions. Everyone knows the hassle when deploying a BizTalk solution. The tools in the framework save an enormous part of the development time.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?