-
Notifications
You must be signed in to change notification settings - Fork 652
[ISSUE]: semver not being read with 6.xx.xx when GenerateNuGetPackageOnBuild = True on csproj #4460
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
Comments
Hi @berndesj. Sorry if I'm so direct. It is not very constructive to create a ticket and say it was working in version 5.x and now it is not working. Also you have not provided any steps to reproduce (sample project). Please keep in mind this is an open source project without any sponsors and just voluntary contributors. Anyway, if I'm not mistaken GitVersion.MsBuild just creates an AssemblyInfo.cs like: [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0+Branch.main.Sha.722aad3217bd49a6576b6f82f60884e612f9ba58")] Why do you think it is a bug in gitversion? Please analyze your problem by yourself and give detail information about what is exactly going wrong. What has changed and why (maybe it was intended)? And if you found a bug then please create a Pull-Request. Thank you for your help! |
hello , yes it is very direct . its my first time that i try to participate in any open source community , i have no experience in the way , fashion or else to deal with helping , working etc. So pardon me my inexperience and i will stay quiet 🤫 and a side while i learn and guide myself alone to help this community . Best regards |
@berndesj thank you for your interest, community help is always welcome |
hello artucic , you are welcome and i want to help . i will try all those suggestion from my welcoming body Copilot and share it with you if it helps. https://chatgpt.com/share/67dab76e-68d8-8011-8b71-5aee1b33806d 👋 |
When you mention VS, do you mean you're doing a build in Visual Studio? The 6.x releases no longer support Visual Studio builds - this would explain why it works on your CI server and at the command-line, but not VS. |
hello ,
thank you for reading and answering .
this is a resume of a conversation with Chatt GPT conserning that issue .
my work around is this
<!-- Diagnostic output to check GitVersion variables -->
<Target Name="ShowGitVersionVars" AfterTargets="Build">
<Message Importance="high" Text="*** GitVersion_NuGetVersionV2: '$(GitVersion_NuGetVersionV2)' ***" />
<Message Importance="high" Text="*** GitVersion_NuGetVersionV2: '$(TargetDir)$(MSBuildProjectName).$(GitVersion_NuGetVersionV2).exe' ***" />
<Message Importance="high" Text="*** TargetFileName: '$(TargetFileName)' ***" />
</Target>
<!-- Rename output if version available -->
<Target Name="RenameOutputWithGitVersion" AfterTargets="Build">
<Exec Condition="'$(GitVersion_NuGetVersionV2)' != ''" Command="move "$(TargetDir)$(MSBuildProjectName).exe" "$(TargetDir)$(MSBuildProjectName).$(GitVersion_NuGetVersionV2).exe"" />
<Message Condition="'$(GitVersion_NuGetVersionV2)' == ''" Importance="high" Text="GitVersion_NuGetVersionV2 was empty, no renaming performed!" />
</Target>
in my csproj SDK style.
But still using 5.12.0 .
6.x.x does not issue any Sem info on my build on Azure pipeline :
using MSbuild or VSbuild or Dotnet build commands
once in a while i will try again see if Microsoft or Gitversion has now better integration.
https://chatgpt.com/share/680e6139-f564-8011-b7e5-883074286656
Again if i have more time i will invest time to do more .
Bernard Desjardins<https://www.linkedin.com/in/bdesjardins/>
Consultant principal
L’efficience, c’est atteindre un maximum de productivité avec un minimum de ressources.
[cid:fb3db86d-d08f-4247-aa8b-8298a6a154a3]
consultants en efficience de l’information inc.<https://www.scief.com/>
Partenaire microsoft
***@***.******@***.***>
+1.514.979.5558
…________________________________
From: James Howat ***@***.***>
Sent: April 29, 2025 4:40 AM
To: GitTools/GitVersion ***@***.***>
Cc: berndesj ***@***.***>; Mention ***@***.***>
Subject: Re: [GitTools/GitVersion] [ISSUE]: semver not being read with 6.xx.xx when GenerateNuGetPackageOnBuild = True on csproj (Issue #4460)
[https://avatars.githubusercontent.com/u/1324380?s=20&v=4]johnnysaucepn left a comment (GitTools/GitVersion#4460)<#4460 (comment)>
when i take a newer version 6.xx.xx it is not read and by default of VS i get 1.0.0 because i don't set Version in the csproj .
When you mention VS, do you mean you're doing a build in Visual Studio?
The 6.x releases no longer support Visual Studio builds - this would explain why it works on your CI server and at the command-line, but not VS.
https://gitversion.net/docs/usage/msbuild
#4130<#4130>
—
Reply to this email directly, view it on GitHub<#4460 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABIP2G5V7JRRJW7OXV5IINT2343IZAVCNFSM6AAAAABZI5XP3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMZXHE2TOMBVGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Prerequisites
GitVersion package
GitVersion.MsBuild
GitVersion version
6.0.0 and sub
Operating system
Windows
What are you seeing?
in my csproj i use Gitversion.MSBULD 5.12.0 and when i build localy or on pipeline the semver calculated is show on my nupkg when the GenerateNuGetPackageOnBuild is TRUE.
when i take a newer version 6.xx.xx it is not read and by default of VS i get 1.0.0 because i don't set Version in the csproj .
What is expected?
i was just expecting to upgrade to 6 and above and it would have kept the version of semversion ....
Steps to Reproduce
take a csproj with gitversion.msbuild with 5.12 ....
then switch to 6.xx and you will see .
don,t forget to set GenerateNuGetPackageOnBuild = true
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
The text was updated successfully, but these errors were encountered: