Wednesday, November 18, 2009

Illegal use of identifier in expression - BizTalk Orchestration error

I got this error when I developed an orchestration and immediately searched in Google to find an answer to resolve the problem. Amazingly, there was no article available in the internet for this issue.

I had no idea why this error is popping.

You also get one more error along with this. The error would look something like

Cannot implicitly convert type '' to string.

Actually this gave me some idea where the error was appearing. The only place i had that string was in a variable. I went to that variable in Orchestration View and removed that string. I rebuilded the Project.

Bingo!!!

No errors.

So, the bottom line is, if you have to initialize a string in a variable, you must enclose the initial value in quotation marks in the Properties window. If you want the string to contain a quotation mark, use the backslash as an escape character, and use consecutive backslashes when you want a literal backslash in your string.