Version Information AssemblyInfo asterisk

AssemblyInfo.cs for C # projects states that you can specify version information with *

 // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] 

I changed it to this:

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

and this is the error I get from the compiler:

 error CS0647: Error emitting 'System.Reflection.AssemblyVersionAttribute' attribute -- 'The version specified '1.0.*.*' is invalid' warning CS1607: Assembly generation -- The version '1.0.*.*' specified for the 'file version' is not in the normal 'major.minor.build.revision' format 

How it works? It works?

+42
c #
Apr 19 '12 at 2:00
source share
3 answers

The syntax (see MSDN ) for the "automatic" build number can be:

 [assembly: AssemblyVersion("1.0.0.*")] 

or

 [assembly: AssemblyVersion("1.0.*")] 

* means that after that everything is automatic. You cannot have an automatic build number and a fixed version number, then this syntax is incorrect:

 [assembly: AssemblyVersion("1.0.*.0")] 

For AssemblyFileVersionAttribute you cannot use the special * character, so you need to provide a full and valid version number. Please note: if you do not provide AssemblyFileVersionAttribute , you will automatically receive FileVersionInfo (with the same version of AssemblyVersionAttribute ). You should specify this attribute only if you need to install a different version.

+57
Apr 19 2018-12-12T00:
source share
 [assembly: AssemblyVersion("1.0.*")] //[assembly: AssemblyFileVersion("1.0.*")] 

just remember to comment out the AssemblyFileVersion line, otherwise the automatically generated version of the assembly will always be "1.0.0.0".

+26
Apr 19 2018-12-12T00:
source share

In my opinion, using [assembly: AssemblyVersion("xyz*")] , Patch should not be automatically numbered. For example:

[assembly: AssemblyVersion ("1.2.3. *")]

Using '*' in AssemblyVersion is good, but follow seemver.org, we should use * for the revision part from the version structure of <major version>.<minor version>.<build number>.<revision> ).

Given the version number of MAJOR.MINOR.PATCH, increase the value:

BASIC version, when you make incompatible API changes,

The MINOR version when you add functionality in a backward compatible way and

PATCH when you do backward compatibility bug fixes.

+3
Jul 24 '15 at 11:19
source share



All Articles