For example, we tried to use a version similar to “0.16.10r2.10717” but we encountered this error:
Error issuing’system.reflection.assemblyversionattribute’-specified The version ‘0.16.10r2.10717’ is invalid.
I searched the Internet, but no one seems to ask for a solution to this problem. Is it possible?
We use Microsoft Visual Studio 2010 and FinalBuilder 7 to build our project.
p>
[assembly: AssemblyVersion("1.2.3.4")]
// Let the compiler generate the build and/or revision numbers
[ assembly: AssemblyVersion("1.2.3.*")]
[assembly: AssemblyVersion("1.2.*")]
There is another attribute AssemblyInformationalVersion, which accepts a string as the version ; When you want to use a more complex string (especially when the submission ID of the DVCS is included), you can use it.
// Use complex version number
[assembly: AssemblyInformationalVersion("0.16.10r2.10717")]
// Include Git commit ID
[assembly: AssemblyInformationalVersion("1.2b1-g39d1c0f")]
In short, the difference between these attributes is:
> AssemblyVersion: This is used as the CLR version of the assembly. When the assembly has a strong name, this is the verified version.> AssemblyFileVersion: This is the Win32 file version resource, displayed in the assembly properties of the Windows Explorer.> AssemblyInformationalVersion: It can be passed Application.P at runtime The roductVersion attribute accesses it. It is also used in the Application.UserAppDataDirectory path.
Is there a way to use a custom format assembly version when building them with MSBuild?
For example, we tried to use a version similar to “0.16.10r2.10717” but we encountered this error:
Error issuing’system.reflection.assemblyversionattribute’-specified The version ‘0.16.10r2.10717’ is invalid.
I searched the Internet, but no one seems to ask for a solution to this problem. Is it possible?
We use Microsoft Visual Studio 2010 and FinalBuilder 7 to build our project.
Both AssemblyVersion and AssemblyFileVersion must consist of up to four integers Composition, separated by periods, each integer is not greater than 65534 (UInt16.MaxValue-1). Any of the following is valid (C# syntax):
[assembly: AssemblyVersion("1.2.3.4")]
// Let the compiler generate the build and/or revision numbers
[assembly: AssemblyVersion("1.2.3.*") ]
[assembly: AssemblyVersion("1.2.*")]
There is another attribute AssemblyInformationalVersion, which accepts a string as the version; when you want to use a more complex string (Especially when the DVCS submission ID is included), you can use it.
// Use complex version number
[assembly: AssemblyInformationalVersion("0.16.10r2. 10717")]
// Include Git commit ID
[assembly: AssemblyInformationalVersion("1.2b1-g39d1c0f")]
In short, difference between these The attributes are:
> AssemblyVersion: This is used as the CLR version of the assembly. When the assembly has a strong name, this is the verified version.> AssemblyFileVersion: This is the Win32 file version resource, displayed on Windows In the assembly properties of the Explorer.> AssemblyInformationalVersion: It can be accessed through the Application.ProductVersion property at runtime. It is also used in the Application.UserAppDataDirectory path.< /p>