We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I've been using GitVersioning in some F# projects, and it's all been working.
However, I tried setting the NBGV_EmitThisAssemblyClass property to false, and then started getting a build error from the generated Version.fs file:
NBGV_EmitThisAssemblyClass
error FS0010: Incomplete structured construct at or before this point in definition
Looking at the code, the version file with the default options is
namespace xxx [<assembly: System.Reflection.AssemblyVersionAttribute("0.7.0.0")>] [<assembly: System.Reflection.AssemblyFileVersionAttribute("0.7.59.18254")>] [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.7.59-prerelease+474e680183")>] do() #if NETSTANDARD || NETFRAMEWORK || NETCOREAPP [<System.CodeDom.Compiler.GeneratedCode("Nerdbank.GitVersioning.Tasks","3.6.133.12845")>] #endif #if NET40_OR_GREATER || NETCOREAPP2_0_OR_GREATER || NETSTANDARD2_0_OR_GREATER [<System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage>] #endif type internal ThisAssembly() = ...
But with NBGV_EmitThisAssemblyClass = false it's
namespace xxx [<assembly: System.Reflection.AssemblyVersionAttribute("0.7.0.0")>] [<assembly: System.Reflection.AssemblyFileVersionAttribute("0.7.59.18254")>] [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.7.59-prerelease+474e680183")>]
without the trailing do(), which seems to be the problem.
do()
Just from a quick look at the GitVersioning code, it looks like the do() gets added by the StartThisAssemblyClass at https://github.com/dotnet/Nerdbank.GitVersioning/blob/2b5ba90c74dc5d3e9300e8079d6ed511536000a9/src/Nerdbank.GitVersioning.Tasks/AssemblyVersionInfo.cs#L741C21-L741C21 and then that isn't called when ThisAssembly is diabled?
StartThisAssemblyClass
This is with version 3.6.133, though the 3.7.48-alpha seems the same.
The text was updated successfully, but these errors were encountered:
Would it be reasonable to have an EndAssemblyAttributes function or similar in the code generator to add the trailing do() ?
EndAssemblyAttributes
Sorry, something went wrong.
Sure, that sounds good. I don't use F# myself. Could you send a PR to fix this?
You may want to target the v3.6 branch instead of main so that we can get it out faster.
main
I'll try to have a look at it later
Do you want a PR against main as well, or will it get merged later?
It will get merged later.
Numpsy
No branches or pull requests
Hi,
I've been using GitVersioning in some F# projects, and it's all been working.
However, I tried setting the
NBGV_EmitThisAssemblyClass
property to false, and then started getting a build error from the generated Version.fs file:Looking at the code, the version file with the default options is
But with NBGV_EmitThisAssemblyClass = false it's
without the trailing
do()
, which seems to be the problem.Just from a quick look at the GitVersioning code, it looks like the
do()
gets added by theStartThisAssemblyClass
at https://github.com/dotnet/Nerdbank.GitVersioning/blob/2b5ba90c74dc5d3e9300e8079d6ed511536000a9/src/Nerdbank.GitVersioning.Tasks/AssemblyVersionInfo.cs#L741C21-L741C21 and then that isn't called when ThisAssembly is diabled?This is with version 3.6.133, though the 3.7.48-alpha seems the same.
The text was updated successfully, but these errors were encountered: