Build Version vs Version Number

I have an asp.net/C# application that uses subversion for version control.

My application automatically increases its AssembleVersion and AssemblyFileVersion for each assembly that works like a charm, and displays the assembly number on the site administration side.

We track AssembleVersion and AssemblyFileVersion during deployment, however, when a problem arises and we need to roll back to a specific version, we have no idea which revision is intended for the purpose in subversion.

I have few ideas:

  • Save AssembleVersion as a comment in each file
  • You have a keyword in the commit comments, which is replaced with AssembleVersion for each commit (you still need to figure out how to do this).

Any help and suggestions would be appreciated.

Updated: option โ€œ1โ€ is actually a stupid idea, because it will mean that every time I build, all files will be marked as updated, and when I complete, each file will be updated

+7
c # svn revision
source share
8 answers

When I build, I put this build number everywhere.

  • I put it in a tag in svn.
  • I put it in the Assembly metadata of each assembly that I create.
  • I add it to the end of the file name in the installers.
  • I placed it in the footer of each of my expanded web pages.
  • I put it in the footer of my reports.
  • I put it in the screensaver of my client applications.
  • I posted it on the welcome screen for my installers.

The only thing I donโ€™t put in is my coffee, which I take black .

All this allows the developer to know exactly where the code came from, so that they can see whether they are viewing a web page or viewing the properties of one of the built-in assemblies in Explorer or something else.

+4
source share
+4
source share

Tags are not very useful if you often create. Maybe find a way to upgrade the assembly version based on the svn version instead? Also indicate the name of the branch because they use the changes.

And you should be able to retrieve the assembly version on your ASP.NET pages and print it programmatically in the footer or something like that.

+3
source share

You can mark a Subversion trunk with AssembleVersion or AssemblyFileVersion, whichever makes the most sense.

You can also track the Subversion version number in the same way that you are currently tracking AssembleVersion and AssemblyFileVersion during deployment.

+2
source share

Apply the tag to the source tree after updating AssemblyVersion and AssemblyFileVersion .

+2
source share

You can "attribute to release." Before creating the release assembly, you can branch the connecting line, and then create a tag in a new branch with the release version number.

  + release tag / +--------------------- release branch / ----------+----------------------------------------------------- trunk 

This will allow you to keep track of all the individual releases in SVN. It will also allow you to make isolated bug fixes on release branches that can be released as patches. The error correction can then be combined back into the trunk.

  + + patch release tag / / +-----------------+-+---- release branch / | merged fix into trunk... ----------+----------------------------------------------------- trunk 
+2
source share

Tags / branches are definitely the recommended approach.

You can also (or optionally) include the svn version number in AssemblyInfo. One approach is to use the AssemblyInfo task from the msbuildtasks project at http://msbuildtasks.tigris.org

For more information google msbuild svn revision assemblyinfo

Then you can do without tags / branches, since you can always check for a specific revision and / or create a branch from a specific revision.

+2
source share

Another option is to use the latest revision as the build number. This means that every time you create an automatic tag. This is easy with hudson / jenkins, since you have the SVN_REVISION environment variable. The problem is that the editorial number is becoming very large, and discussions in the corridors around 1.0.0.20456 versus 1.0.0.20489 are a sip.

0
source share

All Articles