kurgaan
kurgaan

Reputation: 796

assembly version generation in git for a Visual studio Solution

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?

Upvotes: 1

Views: 1911

Answers (1)

dahlbyk
dahlbyk

Reputation: 77580

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.

Upvotes: 1

Related Questions