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

[Bug] MSB4062 The "WriteVersionInfoToBuildLog" task could not be loaded #3704

Closed
christophwille opened this issue Sep 29, 2023 · 2 comments · Fixed by #3751
Closed

[Bug] MSB4062 The "WriteVersionInfoToBuildLog" task could not be loaded #3704

christophwille opened this issue Sep 29, 2023 · 2 comments · Fixed by #3751
Assignees
Labels
Milestone

Comments

@christophwille
Copy link

christophwille commented Sep 29, 2023

I saw #3450

I have 6.0.0-beta.3 of GitVersion.MsBuild installed - my project is .NET 8.0, and I have a global.json that forces 8.0 RC1. Full error message is

Error MSB4062 The "WriteVersionInfoToBuildLog" task could not be loaded from the assembly C:\Users\chwille\.nuget\packages\gitversion.msbuild\6.0.0-beta.3\tools\net6.0/GitVersion.MsBuild.dll. Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask

I have two SDKs only on my machine (it was a blank machine, and I installed VS 17.7.2 initially, now on 17.7.4), obviously none of those is 6.0:

PS C:\Users\chwille> dotnet --list-sdks
7.0.401 [C:\Program Files\dotnet\sdk]
8.0.100-rc.1.23455.8 [C:\Program Files\dotnet\sdk]

As for runtimes, 6.0.22 is installed (in addition to 7 & 8)

Is the only way around this installing the 6.0 SDK? That would be a real pain because as I pointed out, not installing the 6.0 SDK is now the default for VS.

@arturcic
Copy link
Member

as far as I remember .net7.0 is included in the GitVersion.MsBuild, I wonder why it's trying to pick the 6.0 version. I need to check

@arturcic arturcic self-assigned this Sep 29, 2023
@arturcic arturcic added this to the 6.x milestone Sep 29, 2023
@arturcic arturcic added stale and removed stale labels Oct 30, 2023
arturcic added a commit to arturcic/GitVersion that referenced this issue Nov 5, 2023
…aths

The properties GitVersionFileExe and GitVersionAssemblyFile are updated to use the TargetFramework variable in their paths. This change allows for more flexibility in configuration and ensures that the correct versions of the DLL files are used for different target frameworks.
arturcic added a commit that referenced this issue Nov 6, 2023
#3704 - Update GitVersionFileExe and GitVersionAssemblyFile paths
@arturcic arturcic modified the milestones: 6.x, 6.0.0-beta.4 Dec 12, 2023
@arturcic
Copy link
Member

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

2 participants