1

In VS2015 is there a way of writing the changeset number to a file at or after check-in to keep track of which changeset has been deployed?

The only thing I have found so far is this SO: How can I store the new CHANGESET number in my source code after I check in? but that was aimed as VS2010 and it seems like quite a lot of the UI has changed in VS2015 and as a result I am having difficulty following it.

Community
  • 1
  • 1
Joe
  • 43
  • 2
  • 9
  • The changeset number is only generated once the code has been checked in. So, if you then wish to check out the code and add the changeset into the file and check it in again, you'd end up with yet another change that has a newer changeset number! – Don Nov 16 '15 at 22:15
  • Why do you need the changesets in the code. Can't you track what has been deployed based on the dates and labels in the source repo? – Don Nov 16 '15 at 22:16
  • Thanks for the reply. We have so far found file dates to be inaccurate as, with so many different files, many of them end up with different dates after several rounds of patching. It can be quite difficult to work out which dates apply. And I would rather not create multiple changeset numbers just for this which is why I was looking for a solution similar to that which I posted. It seems to inject the changeset number and any other check in information in to the sourcecode at the point of check in. http://logsubstpol.codeplex.com/ – Joe Nov 17 '15 at 08:54
  • Of course, if there is an alternative for the proper maintenance of version numbers in C# MVC web applications I would love to hear them too. – Joe Nov 17 '15 at 08:54
  • @Joe, what's your main requirement? Do you need a list to show which changetsets are deployed and which are not? – Vicky - MSFT Nov 18 '15 at 10:10
  • @Vicky-MSFT, yes, I believe I am. I need a simple and easy way to read way for myself and colleagues to read which changesets have been deployed to which sites. Ideally when we look at a site we can look at a file, see they have changeset (e.g.) 8823 and our current changeset number is 8850 and the comment of one of the changesets in between might be "fixes bug x". Thus we know this site has code with bug x in it, bug x has been already been fixed in a later version and bug x will be fixed with an updated deployment package. Have I explained that well enough? Thanks for getting back to me. – Joe Nov 18 '15 at 14:39

2 Answers2

0

When you do a check-in to TFS, a changeset is created. Assuming all the files get transferred properly into TFS, TFS will generate a changeset number. This number can be used to trace back what code files and work items were worked on.

If you want to queue builds with a specific changeset, you can specify the changeset to build by going to XAML build definition--Process--Advanced--"Get Version". Once you specify the changeset to Get Version, the build will build for this changeset.

Check:

http://blogs.msdn.com/b/dajung/archive/2013/04/17/tfs-basics-changeset.aspx

http://chamindac.blogspot.jp/2013/09/tfs-2012-get-release-build-with.html

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
0

You can use the BuildDetail.SourceGetVersion property to check which changesets are included in one build.

Community
  • 1
  • 1
Vicky - MSFT
  • 4,970
  • 1
  • 14
  • 22