How do you checkin files as part of the build in Visual Studio Team Services? How do you checkin files as part of the build in Visual Studio Team Services? powershell powershell

How do you checkin files as part of the build in Visual Studio Team Services?


I would not recommend to check in the assembly version every time, instead I'd recommend to use the [assembly: AssemblyVersion("1.2.*")] wildcard support (and I remove the [AssemblyFileVersion] so it's automatically matching.

Checking in the changed files after the build has issues in a number of ways:

  • The Index Sources and Symbols feature will be using sources that don't match the code associated with the changeset. This will break advanced debugging scenarios.
  • Advanced test features break and may suggest unwanted tests or changesets
  • History is cluttered with **NO_CI** changesets
  • It breaks semantic versioning as these kinds of scripts don't factor in breaking API changes and may cause funny behavior.

I created a new build task which will allow you to check-in files using a task:

Add it to your visualstudio team foundation services or TFS 2015 instance using the tfx console:

tfx build tasks upload -taskpath path\to\project\root

I'm still working on a way to pend adds and deletes, but I'm running into issues with the Client Object Model somehow not pending anything other than edits.

it looks like calling tf add and tf delete will actually work in the build script in combination with this checkin task.

For more information:


As I commented before.

I would rather discard the changes on AssemblyInfo.* files than check them into the source control.

In my case I use 1.$(date:yy).$(date:MMdd)$(rev:.r) as a build number format

enter image description here

So I will never read back the version from the a AssemblyInfo.* files, so what is the point of saving that information?

The build number format will generate the version again regardless the value stored of the AssemblyInfo.*

If you want to sync source code with an specific version you could use the same build number format to label the source code.

enter image description here