Pavel Voronin
Pavel Voronin

Reputation: 13985

Why does NuGet complain about System.ValueTuple (4.3.1)?

I've just created console F# application for dotnet core 2. VS shows exclamation mark on System.ValueType (4.3.1) package.

Complaining NuGet

I know this reference is implicit:

<PackageReference Include="System.ValueTuple" Version="4.*" Condition=" '$(DisableImplicitSystemValueTupleReference)' != 'true' and '$(_FrameworkNeedsValueTupleReference)' == 'true' ">
</PackageReference>

But NuGet seems to be not ok with the situation. This might be somehow related to this bug, however package manager does not even show System.ValueTuple among referenced packages. Though I see the library when publish application as self contained.

Should I just ignore this or is it indeed an indication of some problem?

Upvotes: 1

Views: 562

Answers (2)

Leo Liu
Leo Liu

Reputation: 76670

Should I just ignore this or is it indeed an indication of some problem?

If you are add the explicitly nuget package, then change it with floating version Version="4.*", you can try to delete the file project.assets.json in the obj folder, then restore the nuget package.

That because the dependencies of this package info are stored in the file project.assets.json in the obj folder. When you change the version from 4.x.x to 4., nuget could not know if those dependencies are still compatible with the version 4.. So Visual Studio may gives the yellow triangle but without any error.

You can check the similar issue here.

Upvotes: 1

Kiran Shahi
Kiran Shahi

Reputation: 7980

There might be conflict between target framework versions and package version.

According nuget.org, System.ValueTuple 4.3.1 is not available dotnet core 2.0 . So in order to use System.ValueType you need to update its Version 4.4.0 or higher.

Upvotes: 1

Related Questions