Search code examples
c#biztalkbiztalk-2013biztalk-orchestrations

Namespace issue in BizTalk Orchestration. Is this a bug?


I found this issue in my working project, wondering if there're any way to avoid this instead of change my projects' namespace:

Here's a simple steps to repeat this issue:

  1. Create a biztalk project, Change the Project's default namespace to, say 'CorpName.EDI.Testing'.

  2. Add a reference to Microsoft.BizTalk.Edi.BaseArtifacts in project

  3. create a new orchestration, simple drop a receive sharp, set it as Activate=True, Set its filter expression as (EDI.ST01 == "997")

  4. create port/messages need to make orchestration looks working.

  5. Build. You shall see build error like this:

    The type or namespace name 'ST01' does not exist in the namespace 'CorpName.EDI' (are you missing an assembly reference?)

The cs code generated from orchestration looks like this:

     new System.Type[] {
        typeof(EDI.ST01)
    },
    new Microsoft.XLANGs.BaseTypes.EXLangPredicateOperator[] {
        Microsoft.XLANGs.BaseTypes.EXLangPredicateOperator.eOpEqual
    },

Clearly. If your own project namespace have "EDI", then the compiler will try to resolve the expression "EDI.ST01" in orchestration with your own project namespace, and it will fail cause you don't have ST01 in your project.


Solution

  • What you are experiencing is a well-known 'behavior' of the Orchestration Designer since BizTalk Server 2004.

    There is no way around it, sorry.

    The only solution is to not use "EDI" in your solution's namespaces.

    It's not specific to "EDI", you fill find the same problem if you try to use "BTS" elsewhere.