Pipelines are implemented in a BizTalk 2004/2006 project for a variety of reasons, including encryption/decryption, splitting single XML documents into multiple documents, and converting flat files into XML documents etc. For doing above mentioned tasks we’ll be using Pipeline components (which gets deployed in different stages of a pipeline). For more information about Pipeline and pipeline components visit here

We need to follow certain procedures before the component get used by Biztalk. They are

1. After building the pipeline component in visual studio, the dll needs to be copied to the location “C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components” (or 2004).

Reasons for that (a) Visual Studio designer will pick up the dll from this location, so you can add them to the visual studio tools, while creating Pipelines. (2) When you start the Biztalk service the “dlls” will be loaded into the host instance (BTSNTSVC service) from this location. and (3) When an isolated host is started (by receiving messages via isolated host instance, i.e HTTP and SOAP adapter) W3WP service load the pipeline component from this location.

2. Since the dll is loaded by Visual Studio (if you have opened a Pipeline Project), BTSNTSVC Service and/or W3WP, you need to stop the BTSNTSVC service, IISRESET and close Visual Studio project (Pipelines development) before copying the dll to the location “C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components” (or 2004).

3. After copying you need to start the BTSNTSVC service.

4. The external components referenced within a pipeline components needs to be deployed in the GAC (Uninstall prior to installation is good).

To do the above steps each time when we make a change will end up as an annoying thing over the development period.

We can cut down some of the steps using the following steps.

1. Create a separate project for pipeline components and the external assemblies its referencing to. Don’t put the pipeline components along with the solution which has Pipelines project (please note Pipelines and pipeline components are two different things)

2. Within Visual Studio, On the pipeline components project, right-click on the project, go to properties, select “Build Events” and click “Edit Post Build…” button. Copy the following script and click OK.

IF $(ConfigurationName) EQU Release GOTO done
xcopy “$(ProjectDir)$(Outdir)$(TargetFileName)” “C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components” /R /Y /F
IF %ERRORLEVEL% EQU 0 GOTO done
net stop “BizTalk Service BizTalk Group : BizTalkServerApplication”
iisreset
xcopy “$(ProjectDir)$(Outdir)$(TargetFileName)” “C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components” /R /Y /F
net start “BizTalk Service BizTalk Group : BizTalkServerApplication”
:done

3. On the external components project referenced by pipeline components, put the following script.

“C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe” /i “$(TargetPath)”

The scripts are quite straight forward, all it does is copies the dll to the correct location, if it gets some sharing violation it slops, BizTalk, IIS and tries again to copy the dll. On the 3rd step it reinstalls the referenced assemblies in the GAC.

The only manual thing you need to do is, close the Visual Studio Pipeline (not pipeline component) project, referencing the pipeline component under development.

I’m sure this will help developers quite a lot of time during pipeline component development.

useful links
Pipeline Component Wizard