dotnet / dotnet/msbuild

Unresolved assembly binding redirect

Open
#4,496 1 comment 2 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

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`

### Steps to reproduce

Project file
```xml


Exe
net471




```

Directory contents:
```
/
- RarDemo.csproj
- Program.cs
```

Program.cs content
```csharp
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
```

![image](https://user-images.githubusercontent.com/47923761/60899454-ccefa000-a26a-11e9-9117-ff1b92a88a30.png)

### 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)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.