Quantcast
Channel: biztalkdeployment Forum Rss Feed
Viewing all articles
Browse latest Browse all 1089

New Post: Use settings spreadsheet to control enable receive location on deploy setting

$
0
0
OK. Unfortunately this is another example of MSBuild's order of evaluation of properties making things harder. When MSBuild loads the .btdfproj and all of its imported targets files, it evaluates the property values. The only thing that can get ahead of that is explicit property declarations in the .btdfproj, command-line parameters and environment variables.

The problem is that we create properties from the settings spreadsheet AFTER that load process is complete. The underlying property that controls this behavior, ControlBizTalkAppStartOption, has already been evaluated by the time this property is loaded from the settings spreadsheet.

One of the limiting factors on this is MSBuild 2.0 which is the common denominator due to our BizTalk 2006 R2 support. I'd have a bit more flexibility on this with MSBuild 3.5.

One workaround is a bit ugly -- redefine the property at runtime with the CreateProperty task in your .btdfproj. You can try this out. It's not ideal for future upgrades so you may have to undo or change it at some point in the future.
<Target Name="RedefinePropertiesAfterSettingsSpreadsheet" AfterTargets="SetPropertiesFromEnvironmentSettings">
  <CreateProperty Value="StartAll" Condition="'$(EnableAllReceiveLocationsOnDeploy)' == 'true' and '$(StartReferencedApplicationsOnDeploy)' == 'true'">
    <Output TaskParameter="Value" PropertyName="ControlBizTalkAppStartOption" />
  </CreateProperty>
  <CreateProperty Value="StartAllOrchestrations,StartAllSendPortGroups,StartAllSendPorts,DeployAllPolicies,StartReferencedApplications" Condition="'$(EnableAllReceiveLocationsOnDeploy)' == 'false' and '$(StartReferencedApplicationsOnDeploy)' == 'true'">
    <Output TaskParameter="Value" PropertyName="ControlBizTalkAppStartOption" />
  </CreateProperty>
  <CreateProperty Value="StartAllOrchestrations,StartAllSendPortGroups,StartAllSendPorts,DeployAllPolicies,EnableAllReceiveLocations" Condition="'$(EnableAllReceiveLocationsOnDeploy)' == 'true' and '$(StartReferencedApplicationsOnDeploy)' == 'false'">
    <Output TaskParameter="Value" PropertyName="ControlBizTalkAppStartOption" />
  </CreateProperty>
  <CreateProperty Value="StartAllOrchestrations,StartAllSendPortGroups,StartAllSendPorts,DeployAllPolicies" Condition="'$(EnableAllReceiveLocationsOnDeploy)' == 'false' and '$(StartReferencedApplicationsOnDeploy)' == 'false'">
    <Output TaskParameter="Value" PropertyName="ControlBizTalkAppStartOption" />
  </CreateProperty>
</Target>
Thanks,
Tom

Viewing all articles
Browse latest Browse all 1089

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>