Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Best practices for .Net assembly versioning

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.98k
    Comment on it

    Hi Friends,

    Assembly versioning is something which doesn’t require superfine logic but it does require a great care. Versioning enables us to identify assemblies deployed and helps in troubleshooting in that exact version.

    When looked from above versioning looks like 4 numbers getting incremented with each build but those numbers mean something and their increment depends on some rules or guidelines.

    So how should that be done and what denotes what in the different numbers displayed in a version no? Let’s find out.

    An assembly version consists of four different parts, which are as following-

    •   Major Version
    •   Minor Version
    •   Build Number
    •   Revision

    Now we’ll see them one by one.

    Major Version

    It is incremented manually for major releases like adding many new features to the application.

    Minor Version

    It is incremented manually for small changes like some changes to existing features in an application. This time, Major Version won’t be changed.

    Build Number

    It is generally incremented automatically as per build performed on the build server. It allows every build to be tracked and tested. It can be put manually too but builds may be much more frequent for an application and put the build no each time manually can be a headache sometimes.

    Revision

    It is incremented for hotfixes or patches to builds released into the production environment. It is set to zero for any initial release.

    We should use same version number for all assemblies compiled as part of a solution as a good practice.

     

    Now when we’re building the solution, we need to take care of following two version numbers:

    File Version

    The assembly file version attribute should be incremented automatically when the build is performed. In the beginning of the build process, Build number portion of the file version is incremented before the build label is applied to source control. It is displayed by windows explorer and never used by  .Net framework for referencing.

    Assembly Version

    The assembly version is used by .Net when linking assemblies. Assembly versions are incremented manually when code branching is done for a release. This should be specified in a “shared assembly info” that ensures that all of the various assemblies in the solution have the same assembly versions. CLR looks for this version no at runtime.

     

    So above are the details about what each number in .Net versioning means and how to increment them. If you have some points to add or some suggestions, please write in the comments section below.

    Thank You.

    Happy Coding.:-)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: