Skip to content
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

System.ValueTuple conflict #182

Open
OwnageIsMagic opened this issue Feb 25, 2022 · 13 comments
Open

System.ValueTuple conflict #182

OwnageIsMagic opened this issue Feb 25, 2022 · 13 comments

Comments

@OwnageIsMagic
Copy link
Collaborator

warning MSB3268: The primary reference "Quartz.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Quartz.dll" or retarget your application to a framework version which contains "System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
due to dependency on System.ValueTuple 4.3.0 in Theraot.Core (3.2.11)
if I add System.ValueTuple 4.5.0 nuget package to the project this error goes away

@NN---
Copy link
Collaborator

NN--- commented Feb 25, 2022

I do not see 4.0.1.0 version in NuGet

https://www.nuget.org/packages/System.ValueTuple/

Probably it is unlisted and can be used.

@OwnageIsMagic
Copy link
Collaborator Author

Looks like System.ValueTuple conflicts with itself
if I only have Theraot.Core (which have System.ValueTuple 4.3.0) it compiles cleanly
In another project where I have Vanara.Core, which have dependency on both System.ValueTuple 4.5.0 and Theraot.Core this error appears

@OwnageIsMagic
Copy link
Collaborator Author

Repro.zip
Here is reproduction
To compile remove one of dependencies in ClassLibrary1

@OwnageIsMagic
Copy link
Collaborator Author

OwnageIsMagic commented Feb 25, 2022

even nastier
it can't build anything that have transitive dependency on Vanara.Core
img
ClassLibrary succeeds, ConsoleApp fails.

@OwnageIsMagic
Copy link
Collaborator Author

Probably you just need to update System.ValueTuple 4.3.0 to 4.5.0 in Theraot.Core to resolve this

@OwnageIsMagic
Copy link
Collaborator Author

And if I set <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> it can't even build ClassLibrary.

@NN---
Copy link
Collaborator

NN--- commented Feb 26, 2022

Probably you just need to update System.ValueTuple 4.3.0 to 4.5.0 in Theraot.Core to resolve this

Or downgrade to 4.0.1.0
Therapy should use the lowest versions possible in order to minimize number of such conflicts.

@OwnageIsMagic
Copy link
Collaborator Author

OwnageIsMagic commented Feb 26, 2022

"System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" is assembly for netstandart (strange version number and it has the same PublicKeyToken)
See 4.3.0 vs 4.5.0 (Framework tab)
I think this is somehow related to dotnet/corefx#42849

@NN---
Copy link
Collaborator

NN--- commented Feb 27, 2022

It could be possible to downgrade the required package version in Vanara.
However the support for .NET 4.0 has been removed.
If this is important to you to have .NET 4.0 supported, please open an issue.

Removed support for .NET 2.0, 3.5, 4.0 and 4.5, .NET Core 2.0, 2.1, a…
…nd 3.0 since all are or shortly will be out of support. Added support for .NET 4.6.2 and 4.8.

@NN---
Copy link
Collaborator

NN--- commented Feb 28, 2022

@OwnageIsMagic The fix is merged into Vanara library.
You just need to build a version for you with .NET 4.0 target.

@OwnageIsMagic
Copy link
Collaborator Author

OwnageIsMagic commented Mar 1, 2022

@NN--- now I have 2 libs with ValueTuple 4.3.0 and 5 with 4.5.0 in my dependency graph
nice job xD

@NN---
Copy link
Collaborator

NN--- commented Mar 1, 2022

Seems like you have inevitable conflict.
You can ask authors of other packages to lower version if this is possible at all.
It can happen with any package. NuGet is not able to handle multiple versions :)

Simply add System.ValueTuple 4.5.0 package reference to your project.

@OwnageIsMagic
Copy link
Collaborator Author

Simply add System.ValueTuple 4.5.0 package reference to your project.

this doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants