BTDF / CodePlexDiscussions

0 stars 0 forks source link

Discussion: Exclude Files from VDirs #34

Open tfabraham opened 6 years ago

tfabraham commented 6 years ago

adicunningham[4/17/2014 1:45:24 PM] Hi,

As part of my BizTalk solution I've created a WCF service project which I want to package as part of the BizTalk MSI. This all works fine and great, however there are a bunch of files that I want to exclude and I can't seem to get that to work. The files I want to exclude are causing my TFS Build to break due to path being too long, since they are not required I want them excluded.

Here is the portion of my project file:

    <ItemGroup>
        <VDirList Include="*" Exclude="**\obj\**;*.csproj;*.cache">
            <Vdir>Polaris.Genius</Vdir>
            <AppPool>Polaris.Genius</AppPool>
            <Physdir>..\Endurance.Re.Polaris.BizTalk.ServiceHost</Physdir>
            <AppPoolNetVersion>v4.0</AppPoolNetVersion>
        </VDirList>
        <PropsFromEnvSettings Include="VDIR_UserName;VDIR_UserPass"/>
    </ItemGroup>

The VDirList by default includes everything by default, so naturally I use the Exclude attribute to ensure specific files are exclude from my build, I've tried various different patterns and not files ever get exclude. It looks like the redist target always copies everything regardless of the Exclude pattern.

Regards, Adrian.

tfabraham commented 6 years ago

tfabraham Hi Adrian,

The Include and Exclude attributes are not used. Since you are using TFS Team Build, you can let the build publish the WCF service website and reference that folder instead of the project folder.

However, an option that will work the same on a dev machine and a build machine is to selectively delete files after the Redist target. You can do that in your .btdfproj with something along these lines: