1

I'm using Visual Studio 2015 and git for version control for a .Net solution. I'm using an Installshield setup project. I need the Solution's assembly version number to increment so that previous installs are removed when new versions are installed. Is there a way to get some kind of incremental numbering from git with every commit that I can use for this?

kurgaan
  • 796
  • 1
  • 7
  • 17

1 Answers1

1

It wouldn't work reliably for builds in feature branches, but for release builds from master you could do something like git rev-list master --count --first-parent to give you a new "version" for every new commit (not counting those merged in). More often, though, you would use an auto-incrementing build number from a CI server (TFS, TeamCity, etc).

As for actually applying this version number to your assembly, there are other answers.

Community
  • 1
  • 1
dahlbyk
  • 75,175
  • 8
  • 100
  • 122