Testing a map with scripting functoid for getting config details form BTSNTsvc file

I have a map where I use external assembly scripting functoid which calls a helper function to get a SQL connection string.

image.png

Helper Function:

Helper

Now if you get this map from repository and after compiling it when you try to test this map you will get this error:

“An error occurred during a call to extension function ‘GetConnectionString’. See InnerException for a complete description of the error. GetConnectionString: Connection String setting not present in config file”

This is because configuration details from btsntsvc.config will be accessible only at runtime.

To test the map either the connection string details need to be put in devenv.config or you need to hard code the connection string to the C# helper method of external assembly.HardCodeAfter adding it there, compile the helper class and GAC it. Restart the visual studio before you test the map.

In case if you update the assembly then again you need to do the same GACing and restart of visual studio before you test your map.

Advertisements

2 thoughts on “Testing a map with scripting functoid for getting config details form BTSNTsvc file

  1. Hi Gautam,

    I had encountered this issue while working on some POC and struggled for hours.
    Unfortunately didn’t found any help over internet as well, I thought that issue might be happening because I have not restarted BizTalk Host, so I restarted it multiple times with no luck and suddenly it clicked to me that while performing Test Map, BTSNTSvc.exe will not be invoked and it’s only happening under devenv.exe. and that’s how I reached this solution to add it in visual studio config file.

    Thanks for documenting this behavior.

    Regards,
    Prashant

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s