Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I auto increment the C# assembly version via our CI platform (Hudson)?
    text
    copied!<p>Myself and my group are horrendous at incrementing assembly version numbers and we frequently ship assemblies with 1.0.0.0 versions. Obviously, this causes a lot of headaches.</p> <p>We're getting a lot better with our practices via our <a href="http://en.wikipedia.org/wiki/Continuous_integration" rel="noreferrer">CI</a> platform and I'd really like to set it up to auto increment the values within the <code>assemblyinfo.cs</code> file so that the versions of our assemblies are auto updated with the code changes in that assembly.</p> <p>I had previously setup (before we found <a href="http://en.wikipedia.org/wiki/Hudson_%28software%29" rel="noreferrer">Hudson</a>) a way to increment the value through either <code>msbuild</code> or the command line (can't remember), but with Hudson, that will update the SVN repository and trigger ANOTHER build. That would result in a slow infinite loop as Hudson polls SVN every hour.</p> <p>Is having Hudson increment the version number a bad idea? What would be an alternative way to do it?</p> <p>Ideally, my criteria for a solution would be one that:</p> <ul> <li>Increments the build number in <code>assemblyinfo.cs</code> before a build</li> <li>Only increments the build number in assemblies that have changed. This may not be possible as Hudson wipes out the project folder every time it does a build</li> <li>Commits the changed assemblyinfo.cs into the code repository (currently <a href="http://en.wikipedia.org/wiki/VisualSVN" rel="noreferrer">VisualSVN</a>)</li> <li>Does not cause Hudson to trigger a new build the next time it scans for changes</li> </ul> <p>Working this out in my head, I could easily come up with a solution to most of this through batch files / commands, but all of my ideas would cause Hudson to trigger a new build the next time it scans. I'm not looking for someone to do everything for me, just point me in the right direction, maybe a technique to get Hudson to ignore certain SVN commits, etc.</p> <p>Everything I've found so far is just an article explaining how to get the version number automatically incremented, nothing takes into account a CI platform that could be spun into an infinite loop.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload