Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the required format for assembly versions?

The Version class in .NET represents version numbers as consisting of two to four components. AssemblyInfo files specify the following format for the AssemblyVersion and AssemblyFileVersion fileds:

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision

It is unclear if Build Number and Revision are required here, since they aren't required in the Version class. Are they required? In other words, is this legal?

[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyFileVersion("1.0")]

Or does that need to be represented as the following?

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
like image 439
Eric Avatar asked Sep 06 '25 03:09

Eric


1 Answers

It appears that the AssemblyVersion may be in a variety of forms:

Examples of valid version strings include:
1
1.1
1.1.*
1.1.1
1.1.1.*
1.1.1.1

But AssemblyFileVersion must be of the form major.minor.build.revision:

The file version is normally a string of four numbers, separated by periods, reflecting the major version number, minor version number, build number, and revision number; for example, "1.0.4309.00". If version is not in this format, a compiler warning occurs, and the results displayed in the file properties dialog are unpredictable. Wildcards are not supported.

like image 137
Eric Avatar answered Sep 07 '25 19:09

Eric