Uses the Microsoft Sync Framework to provide folder synchronisation

Valid TaskActions are:

SyncFolders (Required: Destination, Source Optional: IdFileName, ShowOutput, ExclusionFilters, SyncOptions, Direction)

Remote Execution Support: NA

Namespace: MSBuild.ExtensionPack.FileSystem
Assembly: MSBuild.ExtensionPack.Sync (in MSBuild.ExtensionPack.Sync.dll) Version: 3.5.0.0

Examples

Xml Copy imageCopy
<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <Target Name="Default">
        <ItemGroup>
            <DontSync Include="c:\ASource\*.txt"/>
            <Options Include="ExplicitDetectChanges"/>
            <Options Include="RecycleConflictLoserFiles"/>
        </ItemGroup>
        <!-- Sync two folders and specify an exclusion filter -->
        <MSBuild.ExtensionPack.FileSystem.Sync TaskAction="SyncFolders" ExclusionFilters="@(DontSync)" Source="c:\ASource" Destination="C:\ADest"/>
        <!-- Sync two folders and specify sync options -->
        <MSBuild.ExtensionPack.FileSystem.Sync TaskAction="SyncFolders" SyncOptions="@(Options)" ShowOutput="true" Source="c:\ASource2" Destination="C:\ADest2"/>
    </Target>   
</Project>

Inheritance Hierarchy

System..::..Object
  Microsoft.Build.Utilities..::..Task
    MSBuild.ExtensionPack..::..BaseTask
      MSBuild.ExtensionPack.FileSystem..::..Sync

See Also