How best to use File Version and Assembly Version?

Rick picture Rick · Aug 18, 2008 · Viewed 26.8k times · Source

In .NET there are two version numbers available when building a project, File Version and Assembly Version. How are you using these numbers? Keeping them the same? Auto-incrementing one, but manually changing the other?

Also what about the AssemblyInformationalVersion attribute?

I'd found this support Microsoft Knowledge Base (KB) article that provided some help: How to use Assembly Version and Assembly File Version.

Answer

Jon Dewees picture Jon Dewees · Aug 18, 2008

In solutions with multiple projects, one thing I've found very helpful is to have all the AssemblyInfo files point to a single project that governs the versioning. So my AssemblyInfos have a line:

[assembly: AssemblyVersion(Foo.StaticVersion.Bar)]

I have a project with a single file that declares the string:

namespace Foo
{
    public static class StaticVersion
    {
         public const string Bar= "3.0.216.0"; // 08/01/2008 17:28:35
    }
}

My automated build process then just changes that string by pulling the most recent version from the database and incrementing the second last number.

I only change the Major build number when the featureset changes dramatically.

I don't change the file version at all.