Every now and then, when dealing with BizTalk orchestrations, you might encounter issues you can’t explain. Things like the following, infamous error, may occur without any valid reason:
#error: Errors exist for one or more children
Even after fixing every error, you rebuild the project and/or solution, and the error is still not fixed…
I had this issue a couple of times now to be able to recognize the exact behavior… There actually may be nothing wrong with your logic BizTalk orchestration, in fact something may be wrong with the code behind.
Opening your orchestration with the Visual Studio text editor (right click the odx file and choose ‘Open with…’:
In the generated code in the bottom part of the .odx file, you may find the following culprit:
What seems to happen is that, during compilation, Visual Studio will detect an error in your orchestration, but for some reason ends up adding the compiler error into your code.
After fixing the issue in your orchestration and recompiling, the issue persists, because the compiler somehow refuses to remove the error from the code. And thus a Rebuild always results in the same error.
An odx file actually consists out of the following structure:
#error Do not define __DESIGNER_DATA.
<?xml version=”1.0″ encoding=”utf-8″ standalone=”yes”?>
<om:MetaModel MajorVersion=”1″ MinorVersion=”3″ ……
#endif // __DESIGNER_DATA
internal messagetype myMsg
As you can see, the first part is “DESIGNER_DATA“. This part actually contains an XML representation of your orchestration. The size, shape and position of all of your shapes for example, each of their ID’s, the code you’ve written into expression shapes, etc….
After that part comes the generated code, which is written by Visual Studio each time your orchestration gets recompiled/rebuilt.
The trick is to remove the part after the following line:
#endif // __DESIGNER_DATA
Then, open the orchestration in the designer and make any change to it.
This will force the compiler to regenerate the code from scratch, which results in a correct version of the code (without the #error in it).
Another way would be to remove the line where the #error is in, but I find it safer to let it regenerate everything.
This should fix the issues you have while recompiling/rebuilding the BizTalk orchestration.
One more thing:
Once you opened an .odx file via the Visual Studio Text/XML Editor, you ‘ll need to fix your BizTalk project or your orchestration will always open that editor on double-click, instead of the BizTalk orchestration designer.
Find out how to do this in a blog post I wrote, dealing with just that issue.
Hope this helps! Let me know if it did!