0

I am setting assembly and file version of .net assembly as below,

[assembly: AssemblyVersion("9.05.115.0")]

[assembly: AssemblyFileVersion("9.05.115.0")]

After installing build, I was viewing the file details of the deployed files. I found that the Product Version is displayed correctly 9.05.115.0.

However, the File Version is displayed as 9.5.115.0. So why there no leading zero for “05” in the file version.

Is there any reason? Or Am I missing something?

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
user3249448
  • 1,369
  • 2
  • 14
  • 34

1 Answers1

1

According to here:

The versions are stored internally as integers, so even if you append 0 to the start of the version number, it will be converted to an int and removed.

And here:

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

Community
  • 1
  • 1
James P
  • 2,201
  • 2
  • 20
  • 30