Remove dependency on System.ValueTuple NuGet package when targeting .Net 4.7
See original GitHub issueAfter switching project from .NET 4.6.1 to .NET 4.7.2 the following errors appear:
Severity Code Description Project File Line Suppression State
Error CS8356 Predefined type 'System.ValueTuple`2' is declared in multiple referenced assemblies: 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' ...
The possible reason is that System.ValueTuple is incompatible with .Net Framework 4.7 (because it’s already built in to 4.7).
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
System.Text.Json packages adds System.ValueTuple ...
Text. Json nuget package (v 5.0. 2), see that it says it's going to add dependent packages including System. ValueTuple.
Read more >System.ValueTuple and .NetFramework 4.7.2
This is happening in CI/CD server with MSBuild but not with Visual Studio build in local system. Indirect dependency on the framework assembly( ......
Read more >Could not locate the assembly "System.ValueTuple"
My project has a dependency on System.ValueTuple that is downloaded with NuGet. Everything builds fine in Visual Studio and our build server ...
Read more >Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
Read more >What's new in .NET Framework
See what's new in various versions of .NET Framework. Read a summary of key new features and improvements in each version.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually there is a workaround for now: use a .NET 4.7 build of System.ValueTuple that seems just contains references to value tuple types from mscorlib. There are 2 ways how to do it:
Anyway that’s the best solution, there is no need in the library “System.ValueTuple” at all if one is targeting .NET47 or higher.