Skip to content

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

@christophwille

Description

@christophwille

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.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions