Why assembly binding redirect is not resolved for assembly System.Numerics.Vectors 4.0.4.1 (package : 4.5.0) ?
It should be emited on app.config as package Microsoft.CodeAnalysis.CSharp 3.0.0 depends on package System.Numerics.Vectors >= 4.4.0 (assembly: 4.1.3.0)
We have to add it manually to the app.config to avoid a FileLoadException
using Microsoft.CodeAnalysis.CSharp;
namespace RarDemo
{
class Program
{
static void Main(string[] args)
{
CSharpSyntaxTree.ParseText("class X { private int _x; }");
}
}
}
Command line
msbuild RarDemo.csproj /bl
Expected behavior
Execute without any exception
Actual behavior
System.IO.FileLoadException: 'Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
Environment data
msbuild /version output:
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Why assembly binding redirect is not resolved for assembly
System.Numerics.Vectors
4.0.4.1 (package : 4.5.0) ?It should be emited on app.config as package
Microsoft.CodeAnalysis.CSharp
3.0.0 depends on packageSystem.Numerics.Vectors
>= 4.4.0 (assembly: 4.1.3.0)We have to add it manually to the app.config to avoid a
FileLoadException
Steps to reproduce
Project file
Directory contents:
Program.cs content
Command line
Expected behavior
Execute without any exception
Actual behavior
System.IO.FileLoadException: 'Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
Environment data
msbuild /version
output: Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.15.9.21.664
OS info: windows 10 v1709 (Build 16299.547)