Skip to content

GitVersion produces incompilable code if AssemblyInformationalVersion not defined for F# #1183

@embix

Description

@embix

If you use GitVersion for F# and you haven't already defined an AssemblyInformationalVersion in you AssemblyInfo.fs, (before:)

// Version information for an assembly consists of the following four values:
// 
//       Major Version
//       Minor Version 
//       Build Number
//       Revision
// 
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]

do
    ()

the resulting file will be broken:

// Version information for an assembly consists of the following four values:
// 
//       Major Version
//       Minor Version 
//       Build Number
//       Revision
// 
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("0.2.0.0")>]
[<assembly: AssemblyVersion("0.2.0.0")>]
[<assembly: AssemblyFileVersion("0.2.0.0")>]

do
    ()
[<assembly: AssemblyInformationalVersion("0.2.0-alpha.14+Branch.develop.Sha.69058d74aa75bc26e8dc02665a139e5cf0ca75e0")>]

The compiler will complain "Incomplete structured construct at or before this point in definition".

Workaround: just put a [<assembly: AssemblyInformationalVersion("0.1.0")>] after the other version attributes in your AssemblyInfo.fs. This is ain't a serious bug but more of a suprise. I also like how the commented version is set ;-)

Found in GitVersion is 3.6.1 but could reproduce with 3.6.4 and 4.0.0_beta11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions