Not using the correct ENV settings

Topics: Bindings File, Settings Management and SSO
Sep 14, 2011 at 4:32 PM
Edited Sep 14, 2011 at 4:53 PM

I have everything scripted in terms of using BTDF to compile the MSI and deploy the application.

It works fine in DEV (using the default bindings)

I'm trying to use PortBingsMaster.xml and SettingsFileGenerator.xml for environment specific bindings and something is not working properly there.

I have my settings defined in PortBingsMaster.xml

<!-- ifdef ${ _xml_preprocess} -->
<!-- <Address>${SendQueue_SOAP_PrimaryTransport_Address}</Address> -->
<!-- else -->
<!-- endif -->

and the setting is in SettingsFileGenerator.xml

and it does generate a settings file for each env with the correct settings: Exported_DevSettings, Exported_QASettings, Exported_PRODSettings

and my batch script passes in the proper settings parameter

SET BTDFMSBuildPath="%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
SET ENV_SETTINGS=C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml
SET LOGFILE="C:\Program Files (x86)\WorkOrderProcessing\1.0\DeployResults\DeployResults.txt"
SET BTDFPROJ_FILE="C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\Deployment.btdfproj"
%BTDFMSBuildPath% /p:DeployBizTalkMgmtDB=%BT_DEPLOY_MGMT_DB%;Configuration=Server;SkipUndeploy=true /l:FileLogger,Microsoft.Build.Engine;logfile=%LOGFILE% %BTDFPROJ_FILE%


But it deploys it with the default bindings.

I checked the log and it appears to be correct

             Target ExportSettings:
                "C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\Framework\DeployTools\EnvironmentSettingsExporter.exe" "C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\EnvironmentSettings\SettingsFileGenerator.xml" "C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\EnvironmentSettings"
                Environment Settings Spreadsheet to XML Exporter 1.6.0
                Copyright (C) 2007-10 Thomas F. Abraham.  All Rights Reserved.
                Importing from SettingsFileGenerator.xml...
                Output format is XmlPreprocess (multi-file).
                Skipping environment Local Development (disabled).
                Exporting to Exported_DevSettings.xml...
                Exporting to Exported_QASettings.xml...
                Exporting to Exported_ProdSettings.xml...
            Target InitSettingsFilePath:
                Using settings file C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml
            Target SetPropertiesFromEnvironmentSettings:
                Setting properties from environment settings file (C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml)
                Setting property to value 'BizTalk Application Users'.
                Setting property to value 'BizTalk Server Administrators'.
            Target InitializeAppName:
                BizTalk Application Name is WorkOrderProcessing
            Target PreprocessBindings:
                Clearing file attributes for 'PortBindings.xml'.
                "C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\Framework\DeployTools\xmlpreprocess.exe" /f /v /c /noDirectives /i:"C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\PortBindingsMaster.xml" /o:"C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\PortBindings.xml" /d:CurDir="C:\Program Files (x86)\WorkOrderProcessing\1.0" /s:"C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml"
                XmlPreprocess v2.0.13.0
                Copyright (c) 2004-2010 Loren M Halvorson
                XML File Preprocessor
                Settings XML file: "C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\EnvironmentSettings\Exported_QASettings.xml"
                Preprocessing "C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\PortBindingsMaster.xml" to "C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\PortBindings.xml"...
                PortBindings.xml : Set the value 'WorkOrderProcessing' of 4 node(s) matching XPath '//ApplicationName'.
                "C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\Framework\DeployTools\ElementTunnel.exe" /i:"C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\PortBindings.xml" /o:"C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\PortBindings.xml" /x:"C:\Program Files (x86)\WorkOrderProcessing\1.0\Deployment\Framework\DeployTools\adapterXPaths.txt" /encode+
                Nested XML Encoder/Decoder for BizTalk XML Binding Files v1.2.0.0
                Copyright (C) 2005-2010 Scott Colestock, Tim Rayburn, Thomas F. Abraham

And the only thing that seems amiss is that the Deployment\PortBindings.xml on the QA server shows the following...

<!-- ifdef --> 
<!-- <Address>http://qanlb/SampleWS.QA/PO/WsSendQueue.asmx</Address> -->
 <!-- else -->
<!-- endif --> 

 So it appears that the xmlpreprocess is not properly creating the output file...?


Sep 14, 2011 at 4:40 PM
Edited Sep 14, 2011 at 4:40 PM

It seems to be putting in the proper substitution value into

<!-- <Address>${SendQueue_SOAP_PrimaryTransport_Address}</Address> -->

as it shows

<!-- ifdef -->
<!-- <Address>http://qanlb/SampleWS.QA/PO/WsSendQueue.asmx</Address> -->
<!-- else -->
<!-- endif -->

but I am not sure why it is still commented out with the default value still in there? Is there an additional step that I am missing?

Sep 14, 2011 at 5:05 PM

Hi, depending on the value of the property RequireXmlPreprocessDirectives, you may not need the "ifdef" stuff.  Have you tried eliminating all of the comments and extra Address element and simply using <Address>${SendQueue_SOAP_PrimaryTransport_Address}</Address> all by itself?


Sep 14, 2011 at 5:12 PM

RequireXmlPreprocessDirectives is false, so I'll set that to true and retry.

If that does not work, I'll use your approach. I don't really need the ifdef - I was going by the documentation and trying to stick to the that.