Thursday, September 18, 2014

This property cannot be currently changed. Please unelist the send port before changing this property.

Yesterday we ran into this error while importing a BizTalk binding file for an existing application:

Failed to update binding information. (mscorlib)

This property cannot be currently changed.  Please unelist the send port before changing this property. (Microsoft.BizTalk.ExplorerOM)

(The typo is Microsoft's, not mine)

That is the same error you get when trying to change an enlisted send port to (or from) ordered delivery.

Our situation was weird though, as the existing application had been created using the exact same binding file. Meaning, we have a binding file that can be imported once, but not twice.

The reason for this is rather subtle. Created by a hand the binding file configuring the ordered send port looked somewhat like this:

<SendPort ...>
   ...
  <PrimaryTransport>
   ...
   <OrderedDelivery>false</OrderedDelivery>
   ...
  </PrimaryTransport>
  <SecondaryTransport>
   ...
  </SecondaryTransport>
   ...     
  <OrderedDelivery>true</OrderedDelivery>
   ...
</SendPort>

Note how ordered delivery of the primary transport is set to false while ordered delivery is set to true on the send port itself. This will create a send port with an ordered primary transport on first import, but a second import will make the import fail with the error above.

The solution is to keep the OrderedDelivery tag of the send port in sync with that of the Primary transport

<SendPort ...>
   ...
  <PrimaryTransport>
   ...
   <OrderedDelivery>true</OrderedDelivery>
   ...
  </PrimaryTransport>
  <SecondaryTransport>
   ...
  </SecondaryTransport>
   ...     
  <OrderedDelivery>true</OrderedDelivery>
   ...
</SendPort>

This is however not very clear from the documentation:


Finally a word of caution: import binding can change a send ports delivery status to and from ordered delivery without first having to unenlist the port. I'm investigate whether this is safe or not:

Safe to change sendport delivery status to and from ordered delivery using import binding?


No comments: