Friday, June 15, 2007

A Simple Yet Deceptive Trap

This is something that caught me today. It seems like a pretty simple thing, but had me frustrated for about fifteen minutes.

When compiling a BizTalk project with orchestrations enclosed you may occassionally get a "cannot find symbol" or "invalid reference" message when compiling. This seems like a simple enough problem, just reload your references and things should be fine?

Well occassionally we make silly mistakes. In this instance it turns out that I did not put double quotes around the value propertyof an orchestration variable. It turns out the Intial Value property of an orchestration variable is a live property in that it accepts referernces to objects and other variables. So if you want just a string literal you need to explicitly make Visual Studio aware that what you are entering is a string (quotation marks).

Of course it may be better to design your solution so that the initial value property is pulled from a variable elsewhere, perhaps in an XML file or database somewhere instead of hardcoding inside your orchestration!

No comments: