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:

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

and had this C# function:

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

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).

Filed under: Maps