Skip to content
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

[ISSUE]: GitVersion.MsBuild - GitVersion.MsBuild.targets and GitVersion.MsBuild.props: Error MSB3073 (gitversion.dll not found) in Version 6.0.1 #4148

Closed
2 tasks done
ps-pe opened this issue Aug 8, 2024 · 2 comments · Fixed by #4142
Labels
Milestone

Comments

@ps-pe
Copy link

ps-pe commented Aug 8, 2024

Prerequisites

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

GitVersion package

GitVersion.MsBuild

GitVersion version

6.0.1

Operating system

Windows

What are you seeing?

MS Build error:

Possible reasons for this include:
    * You misspelled a built-in dotnet command.
    * You intended to execute a .NET program, but dotnet---roll-forward does not exist.
  Could not execute because the specified command or file was not found.
    * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
C:\Users\user\.nuget\packages\gitversion.msbuild\6.0.1\tools\GitVersion.MsBuild.targets(18,9): error MSB3073: The command "dotnet --roll-forward Major "C:\Users\user\.nuget\packages\gitversion.msbuild\6.0.1\tools\gitversion.dll" "C:\Projects\a\b\c"  -output file -outputfile "obj\gitversion.json"" exited with code 1. [C:\Projects\a\b\c\Project.csproj]

What is expected?

The path to gitversion.dll should be resolved to:

C:\Users\user\.nuget\packages\gitversion.msbuild\6.0.1\tools\net8.0\gitversion.dll

Steps to Reproduce

  1. Create an empty C# project (e.g. minimal Hello World console app):
<Project Sdk="Microsoft.NET.Sdk.Web">

  <ItemGroup>
    <PackageReference Include="GitVersion.MsBuild" Version="6.0.1">
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
  </ItemGroup>

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <!-- that doesn't work either:  -->
    <!-- <GitVersionTargetFramework>net8.0</GitVersionTargetFramework> -->
  </PropertyGroup>

</Project>
  1. Create GIT repo and build the Project (using dotnet CLI):
    dotnet build

  2. Error

Possible reasons for this include:
    * You misspelled a built-in dotnet command.
    * You intended to execute a .NET program, but dotnet---roll-forward does not exist.
  Could not execute because the specified command or file was not found.
    * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
`C:\Users\user\.nuget\packages\gitversion.msbuild\6.0.1\tools\GitVersion.MsBuild.targets(18,9): error MSB3073: The command "dotnet --roll-forward Major "C:\Users\user\.nuget\packages\gitversion.msbuild\6.0.1\tools\gitversion.dll" "C:\Projects\a\b\c"  -output file -outputfile "obj\gitversion.json"" exited with code 1. [C:\Projects\a\b\c\Project.csproj]`

Notes:
The TargetFramework property is not defined at this point of time and should be moved to GitVersion.MsBuild.targets instead.
https://github.com/GitTools/GitVersion/blob/6.0.1/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props#L20

Version 6.0.0 does work, version 6.0.1 does not work.

RepositoryFixture Test

No response

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

No response

@arturcic
Copy link
Member

arturcic commented Aug 8, 2024

This should be fixed by #4142, in the next release, hopefully soon

@arturcic
Copy link
Member

🎉 This issue has been resolved in version 6.0.2 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants