Valid TaskActions are:

Add (Required: ItemPath or ItemCol Optional: Login, Server, Version, WorkingDirectory, Recursive Output: ExitCode)

Checkin (Required: ItemPath or ItemCol Optional: Login, Server, Comments, Notes, Version, WorkingDirectory, Recursive Output: ExitCode)

Checkout (Required: ItemPath or ItemCol Optional: Login, Server, Version, WorkingDirectory, Recursive Output: ExitCode)

Delete (Required: ItemPath or ItemCol Optional: Login, Server, Version, WorkingDirectory, Recursive Output: ExitCode)

Get (Required: ItemPath or ItemCol Optional: Login, Server, Version, WorkingDirectory, Recursive, Force, Overwrite, All Output: ExitCode)

GetChangeset (Required: VersionSpec Optional: Login, Server, WorkingDirectory Output: ExitCode, Changeset)

GetWorkingChangeset (Required: ItemPath Optional: Login, Server, WorkingDirectory, Recursive Output: ExitCode, Changeset)

Merge (Required: ItemPath, Destination Optional: Login, Server, Recursive, VersionSpec, Version, Baseless, Force Output: ExitCode)

Resolve (Required: ItemPath or ItemCol Optional: Login, Server, Recursive, Version, Auto, NewName)

GetPendingChanges (Required: ItemPath Optional: Login, Server, Recursive, Version Output: PendingChanges, PendingChangesExist Output: ExitCode, PendingChangesExistItem)

UndoCheckout (Required: ItemPath or ItemCol Optional: Login, Server, Version, WorkingDirectory, Recursive Output: ExitCode)

Undelete (Required: ItemPath or ItemCol Optional: Login, Server, Version, WorkingDirectory, Recursive Output: ExitCode)

Remote Execution Support: NA

Namespace: MSBuild.ExtensionPack.VisualStudio
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.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)"/>
    <ItemGroup>
        <FilesToAdd Include="C:\Projects\SpeedCMMI\Demo1\*"/>
    </ItemGroup>
    <Target Name="Default">
        <!-- Check for pending changes -->
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="GetPendingChanges" ItemPath="$/AProject/APath" WorkingDirectory="C:\Projects\SpeedCMMI">
            <Output TaskParameter="PendingChanges" PropertyName="PendingChangesText" />
            <Output TaskParameter="PendingChangesExist" PropertyName="DoChangesExist" />
        </MSBuild.ExtensionPack.VisualStudio.TfsSource>
        <Message Text="Pending Changes Report: $(PendingChangesText)"/>
        <Message Text="Pending Changes Exist: $(DoChangesExist)"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="GetPendingChanges" ItemPath="$/AProject/ADifferentPath" WorkingDirectory="C:\Projects\SpeedCMMI">
            <Output TaskParameter="PendingChangesExistItem" ItemName="PendingChangesExistItem3" />
        </MSBuild.ExtensionPack.VisualStudio.TfsSource>
        <!-- Get a summary of whether changes exist using the PendingChangesExistItem -->
        <Message Text="%(PendingChangesExistItem3.Identity) = %(PendingChangesExistItem3.PendingChangesExist)"/>
        <!-- Perfrom various other source control operations -->
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkout" ItemPath="C:\projects\SpeedCMMI\Demo1" Version="2008" WorkingDirectory="C:\projects\SpeedCMMI"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkin" ItemPath="C:\projects\SpeedCMMI\Demo1" WorkingDirectory="C:\projects\SpeedCMMI" Comments="Testing" Notes="Code reviewer=buildrobot" OverrideText="Justdoit" />
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Add" ItemPath="C:\projects\SpeedCMMI\Demo1" Version="2008" WorkingDirectory="C:\projects\SpeedCMMI"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkin" ItemCol="@(FilesToAdd)" WorkingDirectory="C:\projects\SpeedCMMI" ContinueOnError="true"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkout" ItemCol="@(FilesToAdd)" WorkingDirectory="C:\projects\SpeedCMMI"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="UndoCheckout" ItemCol="@(FilesToAdd)" WorkingDirectory="C:\projects\SpeedCMMI"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Delete" ItemCol="@(FilesToAdd)" WorkingDirectory="C:\projects\SpeedCMMI"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkin" ItemPath="C:\projects\SpeedCMMI\Demo1" WorkingDirectory="C:\projects\SpeedCMMI" ContinueOnError="true"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Undelete" ItemCol="@(FilesToAdd)" WorkingDirectory="C:\projects\SpeedCMMI"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkin" ItemCol="@(FilesToAdd)" WorkingDirectory="C:\projects\SpeedCMMI" ContinueOnError="true"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Get" ItemPath="C:\Projects\SpeedCMMI\Demo1" WorkingDirectory="C:\projects\SpeedCMMI"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Merge" ItemPath="C:\Projects\SpeedCMMI\Client2" Destination="C:\Projects\SpeedCMMI\Client" WorkingDirectory="C:\projects\SpeedCMMI"/>
        <MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Checkin" ItemPath="C:\projects\SpeedCMMI\Client" WorkingDirectory="C:\projects\SpeedCMMI" Comments="Testing" Notes="Code reviewer=buildrobot" OverrideText="Justdoit" />
    </Target>
</Project>

Inheritance Hierarchy

System..::..Object
  Microsoft.Build.Utilities..::..Task
    MSBuild.ExtensionPack..::..BaseTask
      MSBuild.ExtensionPack.VisualStudio..::..TfsSource

See Also