Wordle

Wordle: BTS3

Tuesday, January 6, 2009

Using Script when developing BizTalk projects

After evaluating some reference options, I decided that the best way to reference a DLL in BizTalk project environment is to create a Bin folder that holds the last compiled version of every DLL and in the other projects, add reference to this Bin folder.

It's quite easy to do when non-BTS projects are used. Just add the copy command to the post build events. I'm also adding the command to GAC the DLL (gacutil).

But a BTS project doesn't have the build events option.

So we are using some batch files to do these commands, controlled by the developer.

First we are copying the DLL to our BIN folder. Next we are GACing this DLL, using gacutil command.

Later on we are using the BTSTask command to deploy the DLL into BizTalk management.

We are also holding a batch file that creates the proper application in the management tool (again, using BTSTask).

These batch files, if written properly, can be used later on to deploy the project into the build machine, testing environment (UAT, INTG) and even the production environment.

For me, using these batch files, shorten the development time (especially when solving bug and recompile, redeploy are involved) and simplify the deployment to higher environment

Samples:

Creating the application:

BTSTask AddApp -ApplicationName:%BTSApp%


 

GAC dlls:

gacutil -if %InstalBin%\GS.BTS.Meches.CustomPipelineComponents.dll

if ERRORLEVEL 1 EXIT /B 0

Copy to Bin folder:

XCOPY %Root%\BTS\GS.BTS.Meches.CustomPipelineComponents\bin\%DLLEnv%\GS.BTS.Meches.CustomPipelineComponents.dll %InstalBin%\

if ERRORLEVEL 1 EXIT /B 0

BTSTask:

BTSTask AddResource -ApplicationName:%BTSApp% -Type:System.BizTalk:Assembly -Source:%InstalBin%\GS.BTS.Meches.CustomPipelineComponents.dll -Destination:%%BTAD_InstallDir%%\GS.BTS.Meches.CustomPipelineComponents.dll -Overwrite

if ERRORLEVEL 1 EXIT /B 0