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:

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()) , "1")" />
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:

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.