Reputation: 537
We try to migrate our old XAML build to new build system with task on on-premise TFS2015 Update1. In XAML build we have step where we check-out some files do some modification and do check-in. I found powershell helper where is connection to TFS. Than I can check-out files, get list of pending check-out, but cannot do check-in. When I call
$tfsProvider.Workspace.CheckIn($pendingChanges, "some text")
I get error
Exception calling "CheckIn" with "2" argument(s): "Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies
I think problem is that assembly Microsoft.TeamFoundation.VersionControl.Client.dll depends on assembly Microsoft.TeamFoundation.WorkItemTracking.Client. But this assembly is not in Agent worker folder. Is only way to get this assembly to copy to agent folder or install VS2015 on machine with agent and load assembly from VS folder?
Thanks Regards
Upvotes: 2
Views: 2942
Reputation: 66
Edit the build worspace files and use tf commnads in custom/powershell task eq.
cd $env:BUILD_SOURCESDIRECTORY
$TFFile = Get-Item "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe"
$tfOutput = [string]( & $TFFile.FullName checkin /noprompt /override:"***NO_CI*** New version is $newVersion." /comment:"***NO_CI*** New version is $newVersion." 2>&1)
Catch the TF.exe out it could report the errors event if everyting is ok.
Upvotes: 1
Reputation: 29976
If you want to use TFS API to check in, the assemblies must be installed on the Machine and you must import them in your PowerShell script.
Other ways to check in files would be:
With PowerShell:
You can install TFS Power Tool and use the Windows PowerShell Cmdlets to check in the files. Refer to this link for details:PowerShell and TFS: The Basics and Beyond
With Batch Script: You can install Team Explorer on the machine and use TF Checkin command to check in the files.
Upvotes: 1
Reputation: 901
Just like you said,you must make sure your build agent has the same environment with your dev machine.
The simple way is to copy the dll file on the agent folder. Or you can use Nuget to Install-Package. Suggest you to install VS2015.
Upvotes: 0