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.


Helper Function:


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.