Could not load file or assembly 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
Environemnt
I have clean windows docker image with following versions of .Net Framework installed:
Microsoft .NET Framework 4.6 Targeting Pack
Microsoft .NET Framework 4.6.1 Developer Pack
Microsoft .NET Framework 4.6.1 SDK
Microsoft .NET Framework 4.6.1 Targeting Pack
Microsoft .NET Framework 4.6.1 Targeting Pack (ENU)
Microsoft .NET Framework 4.6.2 Developer Pack
Microsoft .NET Framework 4.6.2 SDK
Microsoft .NET Framework 4.6.2 Targeting Pack
Microsoft .NET Framework 4.6.2 Targeting Pack (ENU)
Microsoft .NET Framework 4.7.1 Developer Pack
Microsoft .NET Framework 4.7.1 SDK
Microsoft .NET Framework 4.7.1 Targeting Pack
Microsoft .NET Framework 4.7.1 Targeting Pack (ENU)
Execution script
#addin "nuget:?package=Cake.Npm&version=0.13.0"
var target = Argument("target", "Default");
Task("NpmInstall")
.Does(() =>
{
NpmInstall();
}
);
Task("Default")
.IsDependentOn("NpmInstall")
;
RunTarget(target);
Cake version
Tried on 0.26.0 and 0.26.1
Expected result
Script to be executed successfully without any errors, npm packages are installed
Actual result
Preparing to run build script...
Running build script...
Error: Could not load file or assembly 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Update: 0.21.0 is working 0.22.0+ fails with that issue
@pascalberger can you offer any help here?
@BggClr In the first post you mention you use Cake.Npm version 0.13.0 with 0.26.0. To which Cake.Npm version are you relating here? Cake.Npm 0.13.0 only supports Cake 0.26.0+ so it is not supposed to work on 0.21.0 or 0.22.0
@pascalberger initially I tried with Cake 0.26.1, then started downgrading to 0.21.0 where I finally get issue related to Cake.Npm version. Once I fixed Cake.Npm with Cake 0.21.0 it finally started working. It seems the issue related with Microsoft.CodeAnalysis which bring the strongly versioned System.ValueTuple (and starting from .Net 4.7 System.ValueTuple is included to the mscorelib with different public key)
If it's an assembly resolution issue, then we potentially could handle that as we do with some mono assembly issues and redirect certain assemblies to known to be present ones.