XSLT Mapping Error: Extension object ‘http://schemas.microsoft.com/BizTalk/2003/userCSharp’ does not contain a matching ‘LogicalEq’

  • Sandro Pereira
  • May 11, 2026
  • 3 min read

While working and making significant changes to an existing BizTalk Mapper today, I got another “fancy” error that is not common to appear:

Microsoft.XLANGs.Core.XTransformationFailureException: Error encountered while executing the transform mapD96A_INVOIC.
Error:Transformation failed.. —> System.Xml.Xsl.XslLoadException:
Extension object ‘http://schemas.microsoft.com/BizTalk/2003/userCSharp’ does not contain a matching ‘LogicalEq’ method that has 2 parameter(s).

📝 One-Minute Brief

When LogicalEq or similar logical functions fail in a BizTalk‑generated XSLT, the safest fix is to replace the condition with a plain XSLT construct like xsl:if or xsl:choose. This avoids runtime errors and makes the mapping clearer and easier to maintain.

Cause

First, let’s understand the root cause of this issue. LogicalEq is the inline C# function that the BizTalk Server generates in the XSLT when we use the Equal Logical Functoid. For example, when we use a similar mapping rule:

LogicalEq

If we later inspect the XSLT generated by the BizTalk Mapper, we will see that at the end of the XSL file, we have this function:

public bool LogicalEq(string val1, string val2)
{
	bool ret = false;
	double d1 = 0;
	double d2 = 0;
	if (IsNumeric(val1, ref d1) && IsNumeric(val2, ref d2))
	{
		ret = d1 == d2;
	}
	else
	{
		ret = String.Compare(val1, val2, StringComparison.Ordinal) == 0;
	}
	return ret;
}

And in the middle of your XSL, you will find an XSLT expression calling that rule:

<xsl:variable name="var:v5" select="userCSharp:LogicalEq(string(s5:EDI_INV_DETAILSRECORD/s5:COD_SCHEDA/text()) , &quot;1&quot;)" />

Well, I was using this kind of mapping strategy, but I switched to an inline custom XSLT because of the complexity. removing the Equal Logical Functoid from the grid page:

without LogicalEq

What happens is that because there wasn’t any other Equal Logical Functoid inside the grid pages, the BizTalk Mapper automatically removes the LogicalEq function from the XSL file… and in my custom XSLT code, I forgot to remove that reference, and I was trying to call that function, causing the issue described above.

Solution

The fix is straightforward. You just need to change that line and the condition you will find in the XSLT into an if statement. For example:

<xsl:if test="string(s5:EDI_INV_DETAILSRECORD/s5:COD_SCHEDA/text()) = '1' ">
...
</xsl:if>

Or in some cases for a xsl:choose block.

Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son. 

Thanks for Buying me a coffe
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top