Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
embix opened this issue Mar 7, 2017 · 1 comment
Labels
Milestone

Comments

@embix
Copy link

embix commented Mar 7, 2017

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.

@endeavour
Copy link

+1. Just got bitten by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants