Unable to promote long context properties

I was busy beavering away on a BizTalk solution today, setting up a context property of type ‘long’, when I hit an error in a receive pipeline:

There was a failure executing the receive pipeline: “Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35” Source: “Pipeline ” Receive Port: “MasterReceivePort” URI: “C:\dev\BtsDrop\MasterIn\*.xml” Reason: Cannot convert “Id” to “long” because the type is not supported. 

I had mapped this property to a data field on a message type, but was inheriting from MessageContextPropertyBase for the property. Aha! I thought, this is because I’m using a context rather than data property – but no, in fact the same error occurs for normal data properties too.

Seems BizTalk just does not support ‘long’ typed promoted properties!

Changing the type to string solved the problem.

As a side note on why I wasn’t using a MessageDataPropertyBase property: I was faced with a situation where sometimes this property would come from the message, and sometimes it would not. I find this often happens when trying to build generic routing patterns. Luckily, BizTalk promotes MessageContextPropertyBase properties in the same way as data properties if they are used to promote a property within a schema. Charles Young has a good post on this type of property.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: