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]: Building with target framework net8.0-windows requires a <GitVersionTargetFramework> #4192

Closed
2 tasks done
aristotelos opened this issue Sep 2, 2024 · 7 comments · Fixed by #4206
Closed
2 tasks done
Assignees
Labels
Milestone

Comments

@aristotelos
Copy link

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.2

Operating system

Windows

What are you seeing?

Build fails when building a project that has <TargetFramework>net8.0-windows</TargetFramework> with a dependency on GitVersion.MsBuild 6.0.2. Build output:

Run dotnet build --no-restore --configuration $env:Configuration
  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\runneradmin\.nuget\packages\gitversion.msbuild\6.0.2\tools\GitVersion.MsBuild.targets(22,9): error MSB30[7](https://github.com/FlaUI/FlaUI.WebDriver/actions/runs/10612608289/job/29414614648?pr=68#step:5:8)3: The command "dotnet --roll-forward Major "C:\Users\runneradmin\.nuget\packages\gitversion.msbuild\6.0.2\tools\net[8](https://github.com/FlaUI/FlaUI.WebDriver/actions/runs/10612608289/job/29414614648?pr=68#step:5:9).0-windows\gitversion.dll" "D:\a\FlaUI.WebDriver\FlaUI.WebDriver\src\FlaUI.WebDriver"  -output file -outputfile "obj\gitversion.json"" exited with code 1. [D:\a\FlaUI.WebDriver\FlaUI.WebDriver\src\FlaUI.WebDriver\FlaUI.WebDriver.csproj]
  WpfApplication -> D:\a\FlaUI.WebDriver\FlaUI.WebDriver\src\TestApplications\WpfApplication\bin\Release\WpfApplication.dll

Build FAILED.

C:\Users\runneradmin\.nuget\packages\gitversion.msbuild\6.0.2\tools\GitVersion.MsBuild.targets(22,[9](https://github.com/FlaUI/FlaUI.WebDriver/actions/runs/10612608289/job/29414614648?pr=68#step:5:10)): error MSB3073: The command "dotnet --roll-forward Major "C:\Users\runneradmin\.nuget\packages\gitversion.msbuild\6.0.2\tools\net8.0-windows\gitversion.dll" "D:\a\FlaUI.WebDriver\FlaUI.WebDriver\src\FlaUI.WebDriver"  -output file -outputfile "obj\gitversion.json"" exited with code 1. [D:\a\FlaUI.WebDriver\FlaUI.WebDriver\src\FlaUI.WebDriver\FlaUI.WebDriver.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:14.83
Error: Process completed with exit code 1.

A workaround is to add <GitVersionTargetFramework>net8.0</GitVersionTargetFramework> to the project file.

What is expected?

It should not be required to add <GitVersionTargetFramework>net8.0</GitVersionTargetFramework> to the project file.

Steps to Reproduce

FlaUI/FlaUI.WebDriver#68

RepositoryFixture Test

No response

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

No response

@rose-a
Copy link
Contributor

rose-a commented Sep 3, 2024

This workaround is currently needed for WIX5 installer projects, too (they usually don't have a target framework set).

@SeppPenner
Copy link

SeppPenner commented Sep 5, 2024

This is not only specific for <TargetFramework>net8.0-windows</TargetFramework>, but also for <TargetFramework>net8.0</TargetFramework>.

I get the same issue:

$ dotnet build --configuration Release --output publish/
  Determining projects to restore...
  Restored /builds/dummy.csproj (in 238 ms).
  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.
    * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
  Could not execute because the specified command or file was not found.
/root/.nuget/packages/gitversion.msbuild/6.0.0/tools/GitVersion.MsBuild.targets(21,9): error MSB3073: The command "dotnet --roll-forward Major "/root/.nuget/packages/gitversion.msbuild/6.0.0/tools/net7.0/gitversion.dll" "/builds/dummy"  -output file -outputfile "obj/gitversion.json"" exited with code 1. [/builds/dummy.csproj]
Build FAILED.
/root/.nuget/packages/gitversion.msbuild/6.0.0/tools/GitVersion.MsBuild.targets(21,9): error MSB3073: The command "dotnet --roll-forward Major "/root/.nuget/packages/gitversion.msbuild/6.0.0/tools/net7.0/gitversion.dll" "/builds/dummy"  -output file -outputfile "obj/gitversion.json"" exited with code 1. [/builds/dummy.csproj]
    0 Warning(s)
    1 Error(s)
Time Elapsed 00:00:01.88
ERROR: Job failed: exit code 1

Short update: I now have a project, where setting <GitVersionTargetFramework>net8.0</GitVersionTargetFramework> doesn't help either and it fails with the same error...

@arturcic
Copy link
Member

arturcic commented Sep 5, 2024

Short update: I now have a project, where setting <GitVersionTargetFramework>net8.0</GitVersionTargetFramework> doesn't help either and it fails with the same error...

Please try version 6.0.2

@SeppPenner
Copy link

Short update: I now have a project, where setting <GitVersionTargetFramework>net8.0</GitVersionTargetFramework> doesn't help either and it fails with the same error...

Please try version 6.0.2

@arturcic I already realized that I was using 6.0.0... It works again with <GitVersionTargetFramework>net8.0</GitVersionTargetFramework>.

@samtrion
Copy link
Contributor

Is there any further information missing, as the PR with a potential fix has been available since mid-September?#4206

@arturcic arturcic added the bug label Oct 31, 2024
@arturcic arturcic linked a pull request Oct 31, 2024 that will close this issue
5 tasks
@arturcic
Copy link
Member

Closed by #4206

@arturcic arturcic modified the milestones: 6.x, 6.0.4 Oct 31, 2024
@gittools-bot
Copy link

🎉 This issue has been resolved in version 6.0.4 🎉
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.

6 participants