Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assembly version ".001" becomes ".1"

In WinForms I have an AssemblVersion

[assembly: AssemblyVersion("01.01.01.002")]

However when the splash screen comes up it completely ignores the zeros showing:

1.1.1.2 

as the version which is very inconvenient since later I will actually want to have an assembly version

 [assembly: AssemblyVersion("01.01.01.200")]

Is there a way to avoid this or do I Have to add some number at the beginning of last part of the version like so:

[assembly: AssemblyVersion("01.01.01.102")]
like image 344
Nickolay Kondratyev Avatar asked Mar 29 '13 00:03

Nickolay Kondratyev


People also ask

What is assembly file version?

It's the version number given to file as in file system. It's displayed by Windows Explorer, and never used by . NET framework or runtime for referencing.

What is the difference between assembly version and file version?

AssemblyVersion: Specifies the version of the assembly being attributed. AssemblyFileVersion: Instructs a compiler to use a specific version number for the Win32 file version resource.

What is assembly versioning explain with example?

Assembly version number For example, version 1.5. 1254.0 indicates 1 as the major version, 5 as the minor version, 1254 as the build number, and 0 as the revision number.

What is the order of an assembly version?

Version information for an assembly consists of the following four values : a major and minor version number, and two further optional build and revision numbers. This should only change when there is a small changes to existing features.


1 Answers

The AssemblyVersion attribute stores it's information as a Version object. The components of the Version struct are integers, and are treated as such. So 1.2.3.4 == 1.02.003.004 but 1.2.3.4 != 1.2.3.400

You can use the AssemblyInformationalVersionAttribute to provide aditional, arbitrarily formatted information about your product, as it's information is stored as a string, rather than a Version. So you can do:

[assembly: AssemblyVersion("1.1.1.102")]
[assembly: AssemblyInformationalVersion("v.01 alpha")]

Or whatever you like

like image 121
p.s.w.g Avatar answered Sep 28 '22 11:09

p.s.w.g