BizTalk: The type or namespace name ‘MessageType’ does not exist in the namespace

While developing BizTalk helper classes or pipeline components, the message type needs to be saved to the message. In case the following error is thrown, the solution is listed below.

Error:
The type or namespace name ‘MessageType’ does not exist in the namespace ‘MyProject.BTS‘ (are you missing an assembly reference?)

Solution:

Set the message property within your C# code (Helper or Utility class)

public static void SetBtsMsgProperty(string propertyName, string propertyValue, ref XLANGMessage message)
{
switch (propertyName)
{
case "*my property name*":
message.SetPropertyValue(typeof(global::BTS.MessageType), **MyMessageTypeHERE**);
break;
}
return;
}

Happy promoting 🙂

Leave a comment