-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Could not load file or assembly 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies #27533
Comments
If I upgrade NuGet packages to recent versions, it looks like the error goes away. Does this mean that 4.3.0 is not actually compatible with net471, despite getting installed? Does it mean the BenchmarkDotNet package owner should require a later one to work around this? What is the right way forward here, so installing the package will result in a successful runtime experience? |
@joperezr is it a known issue? |
cc @adamsitnik |
@sandersaares which version of VS are you using? do you mind sharing a msbuild.binlog of your build when the problem repros? In order to do this, run
This one is interesting as System.ValueTuple isn't one of the assemblies that we inject facades for when targeting 4.7.1. This looks a lot like the problem we fixed on 4.7.1 patch for ValueTuple where the unification table was wrong, but I don't think that this is the problem we are seeing here, since a binidng redirect was added, which seems to be the cause of the problem. the binlog should help understand why was that binding redirect generated. |
I am using VS 15.8.6. |
Oh I see, this is a known issue with packages.config. What I think is going on here is that when you add one of your nuget package dependnecies, then the NuGet package manager is adding the binding redirect into your app.config. This is a bug since the NuGet package manager should never be emitting binding redirects as it doesn't have the full picture of all your references. Can you try the exact same steps, but instead of adding the package depenendencies with VS, add them using <ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.1" />
</ItemGroup> I would expect that doing that should get rid of the error. |
I confirm that adding a Can you post a link to the mentioned NuGet issue report that I could watch? |
I had to manually put
in order for it to be automatically found in .Net 4.6.1 console app. No other recommendations helped. |
@pavel-agarkov Thanks, this is the only solution that worked. I got the same error message with System.ValueTuple version 4.0.3.0. We're targeting .NET 4.7.2. |
I encounter this issue, and seems like the vs problem, and the nuget add the bindingRedirect automatically for me which make the build pass.
|
I have not encountered this in forever, so closing. |
<package id="System.ValueTuple" version="4.3.0" targetFramework="net471" />
inpackages.config
due to some dependency.Expected result: app executes and performs some no-op benchmarks.
Actual result:
I see the following automatically added to my app.config:
I do not see ValueTuple in my bin directory.
The text was updated successfully, but these errors were encountered: