Copy XSL files from RedistDir to Server physical location

Topics: Server Deployment
Jul 29, 2011 at 10:27 PM

Currently I am able to add some xsl files from "Transformations" project folder to RedistDir and then if I hard code the server physical location (C:\Program Files (x86)\TestApp for BizTalk\1.0) then it's working. But I want a way to dynamically find the installation folder and files on the server side. The below is the code currently I am using,


<Target Name="CustomDeployTarget">        <Copy SourceFiles="C:\Program Files (x86)\TestApp for BizTalk\1.0\Test.xsl" DestinationFolder="C:\TEST\XSL\" />  </Target>

<Target Name="CustomRedist">    <Copy SourceFiles="..\$(ProjectName).Transformations\Test.xsl;" DestinationFolder="$(RedistDir)" />  </Target>





Jul 29, 2011 at 10:57 PM

You can include any files into the MSI automatically by including an ItemGroup with one or more AdditionalFiles elements, same structure as Orchestrations, Schemas, etc.  That can replace your CustomRedist Copy task.

Then, if you need to access any of those additional files during the server deploy, you can simply use "..\MyAdditionalFile.ext" in the CustomDeployTarget (and others).  Note that you can make any target conditional -- so if you're using ..\MyAdditionalFile.ext on the server, but in a developer deploy you store it somewhere else, then you can add Condition="'$(Configuration)' == 'Server'" to a target to make it run only on a server deploy.