.btdfproj file token replacement

Topics: Getting Started/Beginner
Mar 7, 2013 at 2:57 PM
We have policy files that are different per environment and I've setup a property in the Exported_LocalSettings.xml, a placeholder for this property in the .btdfproj file and am item group with PropsFromEnvSettings in it. Whenever I deploy the application I can see the property value being set correctly, but it's not being replaced in the location path. The tool ignores the policy section and continues the deployment without error.

Snippet from "Exported_LocalSettings.xml"
<property name="PolicyLocation">..\..\Policies\Local\</property>
Snippets from ".btdfproj"
  <!--Policies to deploy -->
    <RulePolicies Include="VCI.ESB.ContractOrigination.Itinerary.COROffRampEndPoint.xml">
    <PropsFromEnvSettings Include="PolicyLocation" />
Setting properties from environment settings file (D:\Projects\ADG3-EnterpriseArchitecture\VCIEnterprise\ESB\8353\VCI.ESB.COR\VCI.ESB.COR\VCI.ESB.ContractOrigination.Deployment\EnvironmentSettings\Exported_LocalSettings.xml)
Setting property to value '....\Policies\Local\'.
Mar 7, 2013 at 4:09 PM
I actually took a different approach similar to the PortBindingsMaster file and used XmlPreProcess to replace tokens instead of using separate files.
Mar 9, 2013 at 7:05 AM
That's generally the best solution. Just to follow up on your original issue -- the reason it did not work is MSBuild's order of evaluation. When MSBuild parses the .btdfproj, it parses and "materializes" those ItemGroups before it ever gets to the initial execution steps. It is too late to change the ItemGroup definitions by the time you get to the settings export and conversion into MSBuild properties. I believe that moving them below the Import still would not have helped.