GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

[ISSUE]: semver not being read with 6.xx.xx when GenerateNuGetPackageOnBuild = True on csproj

Open berndesj opened this issue 1 year ago • 10 comments

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] I have searched issues to ensure it has not already been reported

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 .

Image

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

Image

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).


berndesj avatar Mar 18 '25 18:03 berndesj

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!

HHobeck avatar Mar 19 '25 08:03 HHobeck

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 avatar Mar 19 '25 11:03 berndesj

@berndesj thank you for your interest, community help is always welcome

arturcic avatar Mar 19 '25 12:03 arturcic

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

👋

berndesj avatar Mar 19 '25 12:03 berndesj

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 https://github.com/GitTools/GitVersion/discussions/4130

johnnysaucepn avatar Apr 29 '25 08:04 johnnysaucepn

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

<Message Importance="high" Text="*** TargetFileName: '$(TargetFileName)' ***" />

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 Desjardinshttps://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)https://github.com/GitTools/GitVersion/issues/4460#issuecomment-2837957055

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 #4130https://github.com/GitTools/GitVersion/discussions/4130

— Reply to this email directly, view it on GitHubhttps://github.com/GitTools/GitVersion/issues/4460#issuecomment-2837957055, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABIP2G5V7JRRJW7OXV5IINT2343IZAVCNFSM6AAAAABZI5XP3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMZXHE2TOMBVGU. You are receiving this because you were mentioned.Message ID: @.***>

berndesj avatar Apr 29 '25 14:04 berndesj

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

github-actions[bot] avatar Jul 29 '25 11:07 github-actions[bot]

l will next week publich my solution with vs2022.

i can now reproduce the azure build with 6.3.0 locally with a powershell script that i add to tool.external in VS.

im working on a profile that when i F5 in vs it attach to the running process then debug step by step.

i hope it will help others

berndesj avatar Jul 29 '25 11:07 berndesj

l will next week publich my solution with vs2022.

i can now reproduce the azure build with 6.3.0 locally with a powershell script that i add to tool.external in VS.

im working on a profile that when i F5 in vs it attach to the running process then debug step by step.

i hope it will help others

Thanks

arturcic avatar Jul 29 '25 11:07 arturcic

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

Wait, what?? Isn't a Visual Studio build just a MSBuild with some wrapping? Why are VS builds no longer supported? That's a very puzzling decision.

NameOfTheDragon avatar Oct 23 '25 13:10 NameOfTheDragon