The AssemblyInfo task uses a regular expression that's written to look for a version of the form major.minor.build.revision, however it is valid for an assembly version to contain only major.minor.build or even only major.minor. This means the regex fails on the last 2 types of version, even though they are valid and the System.Version class successfully parses them. Additionally, the task cannot parse non-numeric version numbers consisting of the character * which is a valid specifier in an [AssemblyVersion] or [AssemblyFileVersion] attribute.
I've written a patch to overcome the above limitations. Versions without full version numbers will have the missing ones defaulted to zero, so major.minor will become major.minor.0.0. Versions with * as a version number (only valid in revision or build fields) will have that * replaced with 0, so major.minor.* will become major.minor.0.
Since the AssemblyInfo task has not changed between 3.5.x and 4.0.x of the Extension Pack, this patch will be applicable to both versions.
Please advise to whom UI should submit this patch and in what format it should be supplied in (as a diff, etc.).
Comments: ** Comment from web user: IanKemp **
I've written a patch to overcome the above limitations. Versions without full version numbers will have the missing ones defaulted to zero, so major.minor will become major.minor.0.0. Versions with * as a version number (only valid in revision or build fields) will have that * replaced with 0, so major.minor.* will become major.minor.0.
Since the AssemblyInfo task has not changed between 3.5.x and 4.0.x of the Extension Pack, this patch will be applicable to both versions.
Please advise to whom UI should submit this patch and in what format it should be supplied in (as a diff, etc.).
Comments: ** Comment from web user: IanKemp **
I've added additional validation because only AssemblyVersion allows the wildcard character. AssemblyFileVersion can legally be any string (this triggers compiler warning CS1607, but csc still builds and embeds the string) but this causes this task to fail to execute. As a workaround I've wrapped the updating of AssemblyFileVersion in a try-catch that skips updating it if an ArgumentException (indicating a non-version version number) is thrown.
Updated files attached.