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] Unexpected error in the WriteVersionInfoToBuildLog task: Could not load file or assembly GitVersionTask.MsBuild, 5.2.4.0. #2205

Closed
SeppPenner opened this issue Mar 26, 2020 · 5 comments
Labels

Comments

@SeppPenner
Copy link

SeppPenner commented Mar 26, 2020

Describe the bug
The bug occurs when building the solution using dotnet build on a NetCore3.1 project solution like this: dotnet build Serilog.Sinks.AmazonS3.sln -c Release.

Error message:

C:\Users\test\.nuget\packages\gitversiontask\5.2.4\build\GitVersionTask.targets(10,9): error MSB4018: Unexpected error in the WriteVersionInfoToBuildLog task. [C:\Users\test\Git\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3.csproj]
C:\Users\test\.nuget\packages\gitversiontask\5.2.4\build\GitVersionTask.targets(10,9): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'GitVersionTask.MsBuild, Version=5.2.4.0, Culture=neutral, PublicKeyToken=null'. The system can not find the stated file. [C:\Users\test\Git\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3.csproj]
C:\Users\test\.nuget\packages\gitversiontask\5.2.4\build\GitVersionTask.targets(10,9): error MSB4018: File name: 'GitVersionTask.MsBuild, Version=5.2.4.0, Culture=neutral, PublicKeyToken=null' [C:\Users\test\Git\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3\Serilog.Sinks.AmazonS3.csproj]

Edit: This worked properly with version 5.1.3 before.
Edit 2: There is no error when built with Visual Studio.

Expected Behavior

The build should succeed without this strange error.

Actual Behavior

Broken build.

Possible Fix

No idea, it looks like something went wrong with the GitVersionTask nuget package.

Steps to Reproduce

You can use my project https://github.com/SeppPenner/Serilog.Sinks.AmazonS3 as example. This should work properly if you have the SDK version 3.1.200 installed. Otherwise check the global.json file and adjust it.

Context

I have no idea where it comes from.

Your Environment

dotnet --info
.NET Core SDK (gemäß "global.json"):
 Version:   3.1.200
 Commit:    c5123d973b

Laufzeitumgebung:
 OS Name:     Windows
 OS Version:  10.0.18363
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.1.200\

Host (useful for support):
  Version: 3.1.2
  Commit:  916b5cba26

.NET Core SDKs installed:
  2.1.802 [C:\Program Files\dotnet\sdk]
  2.2.402 [C:\Program Files\dotnet\sdk]
  3.0.100-rc1-014190 [C:\Program Files\dotnet\sdk]
  3.1.101 [C:\Program Files\dotnet\sdk]
  3.1.200 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview7.19365.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview8.19405.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview9.19424.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-rc1.19457.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview7-27912-14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview8-28405-07 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview9-19423-09 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-rc1-19456-20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview7-27912-14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview8-28405-07 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview9-19423-09 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.0.0-rc1-19456-20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
@SeppPenner SeppPenner added the bug label Mar 26, 2020
@arturcic
Copy link
Member

can you check this comment if it helps? #2063 (comment)

@SeppPenner
Copy link
Author

@arturcic Yep, that solves it.

@arturcic
Copy link
Member

Closing as it's not something GitVersion can fix

@SeppPenner
Copy link
Author

Just if anyone searches this: This issue is a duplicate of #2063.

@SeppPenner
Copy link
Author

@arturcic I'm not sure why, but the workaround didn't work on my build server somehow, but worked very well on my local machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants