Saturday, October 15, 2011

BizTalk Deployment Framework – Always provide the OutputPath!

A hard lesson I learnt….as I was fiddling around with the BizTalk Deployment Configuration, ALWAYS make sure to define a property group applicable to your configuration and be sure to set the OutputPath. I had defined several propertygroups and modified the conditions to make sure it would work on a build server (provided additional MSBuild properties), however I forgot one combination, the PropertyGroup for the ‘Release’ configuration. I had set my BTDF project to configuration ‘Release’….which led to a not so cool outcome…files were removed from C:\

This is caused by the WixTargets file (MSBUILD\Deployment Framework For BizTalk\5.0\BizTalkDeploymentFramework.WiXSetup.targets;

      <!-- Delete any existing output files -->
    <CreateItem Include="$(OutputPath)\**\*.*">
      <Output TaskParameter="Include" ItemName="OutputsToClean" />

If the $(OutputPath) is not provided the value become “.” causing the effect.

You can overcome this (until RC2 is out) by adding the following to you targets file:

  <Target Name="Installer" DependsOnTargets="Redist">
           <Error Text="The build was aborted, no OutputPath provided"  

          Condition="'$(OutputPath)'" />

Which will stop the build;


"C:\Projects\Rfs.Integration\Dev\Rfs.Integration.Common\Rfs.Integration.Common.Deployment\Rfs.Integration.Common.Deployment.btdfproj" (Installer target) (1) ->
(NoOutputPath target) ->
  C:\Program Files (x86)\MSBuild\DeploymentFrameworkForBizTalk\5.0\BizTalkDeploymentFramework.WiXSetup.targets(206,3): error : The build was aborted, no OutputPath provided [C:\Projects\Rfs.Integration\Dev\Rfs.Integration.Common\Rfs.Integration.Common.Deployment\Rfs.Integration.Common.Deployment.btdfproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.23


Hope this prevents someone from making the same mistake. Also, make sure you make enough backups! (and keep them Bedroefde emoticon)



No comments: