23 March, 2010

Ross' Inaugural Post: Biztalk Config Settings

Note to Selves: evidently code that retrieves settings from the Biztalk config file (BTSNTSvc.exe.config) such as:

ConfigSettings = (System.Collections.Specialized.NameValueCollection) System.Configuration.ConfigurationSettings.GetConfig("MySchedule");
My_Dynamic_SP(Microsoft.XLANGs.BaseTypes.Address)= "mailto:" + ConfigSettings.Get("ValidationErrorsEmailTo");

... cannot be used in a Construct Message shape because the NameValueCollection is somehow retrieved as a ReadOnlyNameValueCollection, and that class is not serializable, and that is unacceptable (the transaction type of everything is set to 'None'). Nor, does it seem, can it be done in an Expression shape in a Decision tree for (most likely) the same reason.

I put it in an Expression shape near the beginning of the orchestration, saved the value to a variable, i.e.:

errorEmailTo = ConfigSettings.Get("ValidationErrorsEmailTo");

... and used the variable later on in the Decision tree, and everything works. For now.

No comments:

Post a Comment