Is there any way to use a custom format for assembly versions, when building them with MSBuild?
For example, we tried to use a version like “0.16.10r2.10717” But we got this error:
error emitting 'system.reflection.assemblyversionattribute' -- The version specified '0.16.10r2.10717' is invalid.
I searched around the web, but seems no one asked for a solution of this. Is it possible?
We use Microsoft Visual Studio 2010, and FinalBuilder 7 for building our project.
AssemblyVersion and AssemblyFileVersion both must be composed of up to four integers, period-separated, each of which is no larger than 65534 (
UInt16.MaxValue-1). Any of the following are valid (C# syntax):There is another attribute, AssemblyInformationalVersion, that accepts a string as the version; it can be used when you want to use more complicated strings (especially when including a commit ID from a DVCS).
Briefly, 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 version that is validated against.
AssemblyFileVersion: This is the Win32 file version resource, and is displayed in the assembly’s properties in Windows Explorer.
AssemblyInformationalVersion: This is accessible at runtime via the
Application.ProductVersionproperty. It is also used in theApplication.UserAppDataDirectorypath.