BizTalk Map: HRESULT: 0x80131942, issue is calling Csharp GetTimeStamp function from XSLT inline code

Error when running from BizTalk run time environment: Exception from HRESULT: 0x80131942
(no other details were provided)

Exact error when running “Test Map” in Visual Studio: Does not contain a matching ‘GetTimestamp’ method that has 0 parameter(s).

I was transferring a BizTalk map from 2010 to 2013.

There was an XSLT inline that had the following:

<pre>
<xsl:variable name="timeStamp" select="userCSharp:GetTimestamp()"/>
</pre>

and had this C# function:

<pre>
<ScripterCode><Script Language="CSharp">
<![CDATA[public string GetTimeStamp()
{
DateTime date = DateTime.Now;
return date.ToString("HH:mm");
}]]>
</Script>
</ScripterCode>
</pre>

It turns out in my particular case, the function name didn’t actually match, the “s” of “GetTimeStamp” either needed to be capitalized or lower case in both places where it is used.

This blog also shows how to get the time within an XSLT function (in a BizTalk map).

Uncategorized  

Leave a Reply