Menu

#194 AssemblyInformationalVersion should accept any string

closed-fixed
nobody
None
5
2010-07-28
2010-07-28
Dawid Weiss
No

AssemblyInformationalVersion is parsed as a Version and it should accept arbitrary strings. In IKVM's VersionInfo.cs:

if (informationalVersion != null)
{
Version productver = new Version(informationalVersion);
productVersionMajor = productver.Major;
productVersionMinor = productver.Minor;
productVersionBuild = productver.Build;
productVersionRevision = productver.Revision;
}

This attribute accepts arbitrary strings and allows developers to set unconstrained information about the build. An example source code in C# is attached that utilizes all three version attributes (assembly, file and informational version), it compiles fine. The same Java source, compiled with IKVM, crashes with an error:

System.ArgumentException: Version string portion was too short or too long.
at System.Version..ctor(String version)
at IKVM.Reflection.Writer.VersionInfo.Write(ByteBuffer bb)
at IKVM.Reflection.Emit.AssemblyBuilder.Save(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
at IKVM.Internal.CompilerClassLoader.Save()
at IKVM.Internal.CompilerClassLoader.Compile(String runtimeAssembly, List`1 optionsList)
at IkvmcCompiler.Main(String[] args)

Discussion

  • Dawid Weiss

    Dawid Weiss - 2010-07-28

    Correct C# and Java code utilizing assembly version strings.

     
  • Jeroen Frijters

    Jeroen Frijters - 2010-07-28

    Thanks. Fixed in cvs. Fix will be in 0.44.0.3.

     
  • Jeroen Frijters

    Jeroen Frijters - 2010-07-28
    • status: open --> closed-fixed
     

Log in to post a comment.