Recently I was working with a custom pipeline component in BizTalk 2006.  As you know, a change was made to how these components behave in BizTalk 2006.  That is, now they can be placed in the GAC as well as in the \Pipeline Components directly.  So what does this mean?  Put them in both place, one place, who knows?

In general, the rule is when working with custom pipeline components on a development system put the components in the \Pipeline Components folder and put them in the GAC on non-development systems.  Although this is not really the approach the help guide says (under Developing Custom Pipeline Components), this approach works great since it simplifies deployment.

Today, I found a big GOT YOU with this approach if the custom component is not GACed before it is used inside the designer.  All in all, you must GAC the custom pipeline components as soon as your create them and BEFORE adding them to the Visual Studios Toolbox.

Let's take a look at what happens when you add an unsigned and unGACed custom pipeline component to a project.

When you add the component to the Toolbox and drag it into the design surface, a reference is added to the pipeline component.  As seen below, when the component is not signed and not in the GAC a reference is added to the component in the \Pipeline Components folder.

UnSigned and UnGaced

Fig 1: Unsigned and unGaced 

Now, let's take a look at what happens when you add a signed and GACed custom pipeline to a project.

When you add the component to the Toolbox and use it in a pipeline, a reference is added to the pipeline component (as before).  But this time, the signed and GACed pipeline is referenced to the GACed version of the pipeline component as seen below.

 Signed and GACed

Fig 2: Signed and GACed

So why does this matter?  Well, the problem I ran into was I added my custom pipeline component to my pipeline before I signed and GACed it.  So when I went to deploy my solution to the development server with the pipeline component only in the GAC, I got a .net error saying it could not find the pipeline. 

Something else to point out is that the pipeline must be GACed before you add the pipeline component to the Toolbox.  Just being signed is not good enough.

The moral of the story: If you only want to put your component into the GAC and not into the Pipeline Component folder make sure you GAC it before you use it.