Skip to content

[ISSUE]: dotnet build fails after GitVersion.MsBuild nuget package added to C# project #4157

Description

@anyfreenick

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?

I have a console app, target framework - .NET8.0.
I've added nuget package - GitVersion.MsBuild - version 6.0.1
Now I try to build my by typing in console - dotnet build and getting the following error:

C:\Users\<user_name>\SRC\C#\CSVParser.NET> dotnet build
  Determining projects to restore...
  All projects are up-to-date for restore.
  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_name>\.nuget\packages\gitversion.msbuild\6.0.1\tools\GitVersion.MsBuild.targets(18,9): error MSB3073: The command "dotnet --roll-forward Major "C:\Users\<user_name>\.nuget\packages\gitversion.msbuild\6.0.1\tools\gitversion.dll" "C:\Users\<user_name>\SRC\C#\CSVParser.NET\CSVParser.NET"  -output file -outputfile "obj\gitversion.json"" exited with code 1. [C:\Users\<user_name>\SRC\C#\CSVParser.NET\CSVParser.NET\CSVParser.NET.csproj]
Build FAILED.
C:\Users\<user_name>\.nuget\packages\gitversion.msbuild\6.0.1\tools\GitVersion.MsBuild.targets(18,9): error MSB3073: The command "dotnet --roll-forward Major "C:\Users\<user_name>\.nuget\packages\gitversion.msbuild\6.0.1\tools\gitversion.dll" "C:\Users\<user_name>\SRC\C#\CSVParser.NET\CSVParser.NET"  -output file -outputfile "obj\gitversion.json"" exited with code 1. [C:\Users\<user_name>\SRC\C#\CSVParser.NET\CSVParser.NET\CSVParser.NET.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.73

As I found out the file C:\Users\<user_name>\.nuget\packages\gitversion.msbuild\6.0.1\tools\gitversion.dll does not exist
It exists at net6.0 and net8.0 subfolders under *C:\Users\<user_name>\.nuget\packages\gitversion.msbuild\6.0.1\tools* folder

What is expected?

Build successful

Steps to Reproduce

  1. Create console project using Visual Studio, Select target framework .NET8.0
  2. Add nuget package GitVersion.MsBuild, version 6.0.1
  3. Run dotnet build from solution folder

RepositoryFixture Test

No response

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

No response

Activity

  1. arturcic commented on Aug 12, 2024

    @arturcic
    Member

    duplicate of #4148

  2. added this to the 6.x milestone on Aug 12, 2024
  3. modified the milestones: 6.x, 6.0.2 on Aug 12, 2024
  4. arturcic commented on Aug 12, 2024

    @arturcic
    Member

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

    Your GitReleaseManager bot 📦🚀

  5. mrt181 commented on Apr 8, 2025

    @mrt181

    @arturcic I have the same issue again with 6.2.0. Going back to 6.1.0 fixes it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions