Random Compiler errors "The expression that you have entered is not valid."

This was a very interesting bug that came up during the holidays; yeap we were busy troubleshooting over Christmas :).

The issue was very intermittant and hard to repro (as always) and we had to resort to multiple iterations with the customer and support team just to get a complete understanding of the problem.  The OD throws compile errors randomly and a error {!} sign is shown next to the expression shape. When you open the Expression shape, you find that parts of some messages are underlined by red marks to indicate that the parts are missing type references.

Let’s say there are two orchestrations inside the same project with namespaces as “A.B” and “A.B.C”. OD (Orchestration designer) adds these as the modules (BTSModule) to the XLANG compiler. Each module is supposed to create a scope so BTSModule creates a new scope symbol for the last name of the namespace and replaces the existing ones if any with the new one.

So now consider a scenario where “A.B.C” is added first, so the symbol table is populated with a tree which looks like A -> B -> C (-> is used for better presentation). Where ‘C’ is a scope symbol. Now if OD adds “A.B”, then the compiler replaces the existing namespace symbol “B” by new scope symbol B”, while doing so the references to “C” is gone. So now the tree looks like A->B.

But later when we are adding the message types in “A.B.C” namespace are succeeding why? BTSModule also in-turn holds the root of the module and uses it while adding the parts. So the types are added to a local symbol not to the one A->B… But later when the expressions are evaluated the actual symbol tree is used causing the failure.

Root cause: It’s to do with the order in which the modules are added to the compiler.
Solution: Modified the OD (Orchestration designer) to create the BTS modules in a sorted manner.

This fix is being released as KB979153 and should be available soon.

- Guru

Comments (5)

  1. Cosmas Kange says:

    Is there a supported fix for BizTalk 2006 R2? We have been dealing with this issue for quite some time now.


  2. JK says:

    Thanks. This post helped me get rid of my compile error. But the error was due to my own reference not a BTSModule.

  3. Raja Kumaravel says:

    I had this issue and solved it in below ways.

    Open that particular expression shape and go to last line of each statement and press the delete button until it won’t affect the next line code.

    Now close the visual studio and reopen again and try to build the application.

  4. Sandeep says:

    Hi Raja,

    I Just did how u said, It worked fine. Thanks a lot. You are always best.

  5. Omar Djaiz says:

    In my case, it was within Biztalk 2013 (Migrated from BT2010).

    I had to remove the spaces before and after the == sign in the expression.

    Really weird bugs !!!  

    Many thanks for the post. You saved my day Raja.

Skip to main content