Tuesday, March 15, 2011

How can I set leading zeros in AssemblyVersion like "2.03.406.2" in .net

just adding a zero like below

[assembly: AssemblyVersion("2.03.406.2")]

results in 2.3.406.2

which is not what I want.

So this may not be possible?

From stackoverflow
  • Each number represents a specific numerical value, Major, Minor, Build and Revision.

    It isn't just an arbitary string.

  • Each portion of the assembly version is stored as a 16-bit integer, so no, it's not possible.

  • Probably you can read AssemblyFileVersionAttribute

    AssemblyFileVersionAttribute[] attributes = (AssemblyFileVersionAttribute[])typeof(Program)
        .Assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false);
    Console.WriteLine(attributes[0].Version);
    

0 comments:

Post a Comment