This project is read-only.

AssemblyInfo UpdateVersion: test for format of the "old value" of the specified version number is failing

Dec 12, 2014 at 4:42 PM
Hi,

We're enhancing our build process to set various properties in the assemblyinfo.cs_ files (company, copyright, version, etc.) to a standard value for all projects in the solution. The purpose is to not require the programmers to fill this in and that they are consistent across the assemblies. We're hitting an exception in UpdateVersion_ where it tests the format of the original value of the version string. In our case the value is "1.0" which throws the Format Exception "Current value for attribute '" + attributeName + "' is not in a correct version format." as it's expecting "1.0.0.0".

The code specifically is:
  if (!VersionParser.IsMatch(oldValue))
  {
      throw new FormatException("Current value for attribute '" + attributeName + "' is not in a correct version format.");
  }
Does anyone know why this test is in there? Am I missing something?

I'd prefer to not have to change the offending assemblyinfo files because as we add new assemblies this problem may recur inadvertently.

Thanks,

Glenn