dotnet / dotnet/maintenance-packages

Using latest ValueTuple package in .NET 4.7.1 or later in a project that has source authored bindingRedirects results in warning MSB3836 or FileNotFoundException

Open
#258 9 comments 3 reactions 0 assignees View on GitHub
documentation
Dominant language
C#
Stars
44
Forks
24
Avg merge
2d 14h
Merged PRs (30d)
1

Description

If a project already has a source-authored bindingRedirects in app.config that downgrade the ValueTuple assembly version, the following warning may be emitted:
```
warning MSB3836: The explicit binding redirect on "System.ValueTuple, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" conflicts with an autogenerated binding redirect. Consider removing it from the application configuration file or disabling autogenerated binding redirects. The build will replace it with: "".
```

If that project is then run after the redirects are rewritten, or if other redirects (not downgrade) existed, a runtime error like the following will occur.
```
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.ValueTuple, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
```

In both cases the fix is to *remove* the bindingRedirectm for System.ValueTuple. System.ValueTuple is present in .NET 4.7.1 and later and does not require bindingRedirects.

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.