I am not sure how many of you are particular about privacy and entitle every method you see and write with a “Private” access modifier. I reckon the count is at large but if you are dealing with such a transformation solution that is heavily reliant on scripting functoids in BizTalk “2013”, well I got news! It just doesn’t happen that way.
Here is my simple “Inline C#” scripting functoid that encompasses the very basic MyConcat method. The only difference I made in the built-in code was to change the access modifier from “Public” to “Private”
private string MyConcat(string param1, string param2)
Test your map and you will get the below error
Error 3 XSL transform error: Unable to write output instance to the following <file:///D:\Share\MapperDemo\MapperDemo\Sample Files\OPSample.xml>. Method ‘MyConcat’ of extension object ‘http://schemas.microsoft.com/BizTalk/2003/userCSharp‘ cannot be called because it is not public. D:\Share\MapperDemo\MapperDemo\MapperPrj\Transform.btm 1 1
The result is pretty same if you try an “Inline VisualBasic.NET” code with the exception of the namespace it refers to.
Private Function MyConcat(ByVal param1 As String, ByVal param2 As String) As String
And this is my error below
Error 3 XSL transform error: Unable to write output instance to the following <file:///D:\Share\MapperDemo\MapperDemo\Sample Files\OPSample.xml>. Method ‘MyConcat’ of extension object ‘http://schemas.microsoft.com/BizTalk/2003/userVB‘ cannot be called because it is not public. D:\Share\MapperDemo\MapperDemo\MapperPrj\Transform.btm 1 1
However, in earlier versions of BizTalk this works like spell! The explanation for this change could be attributed to the advent of a brand new Transform Engine BizTalk 2013 brought along. The new transformation engine uses the newer “.NET XSLCompiledTransform” rather than the older and now obsolete “.NET XSLTransform”. The new XSLCompliedTransform has substantial memory and performance improvements over XSLTransform but it doesn’t support Private methods anymore.
Nevertheless, if you still want your maps be compiled by the old .NET XSLTransform, few tweaks in the Registry should do the job for you. Important thing to note is this approach is NOT recommended.
This change can be made by adding DWORD UseXslTransform with value 1 at the following locations:
- For 64 bit BizTalk host instances: HKLM\SOFTWARE\Microsoft\BizTalk Server\3.0\Configuration
- For 32 bit BizTalk host instances and Visual Studio’s Test Map functionality: HKLM\SOFTWARE\Wow6432Node\Microsoft\BizTalk Server\3.0\Configuration
And when you want to roll the changes back, simply delete the newly created DWORD UseXslTransform.