Skip to content

dotnet build command always fails with GitVersionTask 4.0.0-beta #1399

Closed
@walterlv

Description

@walterlv

When a totally new .NET Standard project is created and GitVersionTask is installed on it, dotnet build command certainly fails with this message below:

C:\Users\walterlv.nuget\packages\gitversiontask\4.0.0-beta0012\build\GitVersionTask.targets(49,5): error MSB4062: The "GitVersionTask.WriteVersionInfoToBuildLog" task could not be loaded from the assembly C:\Users\walterlv.nuget\packages\gitversiontask\4.0.0-beta0012\build\GitVersionTask.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL'. The system cannot find the file specified. Confirm that the 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. [C:\Users\walterlv\Desktop\XxxYyyZzz\XxxYyyZzz\XxxYyyZzz.csproj]

The raw error message is here:

> dotnet build
Microsoft (R) Build Engine version 15.6.84.34536 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 42.12 ms for C:\Users\walterlv\Desktop\XxxYyyZzz\XxxYyyZzz\XxxYyyZzz.csproj.
C:\Users\walterlv\.nuget\packages\gitversiontask\4.0.0-beta0012\build\GitVersionTask.targets(49,5): error MSB4062: The "GitVersionTask.WriteVersionInfoToBuildLog" task could not be loaded from the assembly C:\Users\walterlv\.nuget\packages\gitversiontask\4.0.0-beta0012\build\GitVersionTask.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL'. 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. [C:\Users\walterlv\Desktop\XxxYyyZzz\XxxYyyZzz\XxxYyyZzz.csproj]

Build FAILED.

C:\Users\walterlv\.nuget\packages\gitversiontask\4.0.0-beta0012\build\GitVersionTask.targets(49,5): error MSB4062: The "GitVersionTask.WriteVersionInfoToBuildLog" task could not be loaded from the assembly C:\Users\walterlv\.nuget\packages\gitversiontask\4.0.0-beta0012\build\GitVersionTask.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL'. 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. [C:\Users\walterlv\Desktop\XxxYyyZzz\XxxYyyZzz\XxxYyyZzz.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.40

Fortunately, if I build it using msbuild.exe or Visual Studio 2017, it succeeds.

My environment:

  • Windows 10.0.16299.371
  • Visual Studio 2017 (15.6.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions