Peter Hahndorf
Peter Hahndorf

Reputation: 11222

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?

Upvotes: 3

Views: 1420

Answers (3)

Mike Chaliy
Mike Chaliy

Reputation: 26668

Probably you can read AssemblyFileVersionAttribute

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

Upvotes: 2

Sören Kuklau
Sören Kuklau

Reputation: 19930

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

Upvotes: 7

AnthonyWJones
AnthonyWJones

Reputation: 189467

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

It isn't just an arbitary string.

Upvotes: 1

Related Questions