GitTools/GitVersion

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

Closed this issue ยท 2 comments

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

duplicate of #4148

๐ŸŽ‰ This issue has been resolved in version 6.0.2 ๐ŸŽ‰
The release is available on:

Your GitReleaseManager bot ๐Ÿ“ฆ๐Ÿš€