15

From the last (or maybe the two last) update, I can't update the package NETStandartLibrary in Nuget. I just create a new standard library project. See this message :

enter image description here

In project's properties, the version is different :

enter image description here

And in the .csproj :

<Project Sdk="Microsoft.NET.Sdk">

   <PropertyGroup>
       <TargetFramework>netstandard1.4</TargetFramework>
   </PropertyGroup>

</Project>

In Nuget, I add the dependency 'Microsoft.EntityFrameworkCore', then I got the warning :

Warning Detected package downgrade: NETStandard.Library from 1.6.1 to 1.6.0 AgainTest (>= 1.0.0) -> Microsoft.EntityFrameworkCore (>= 1.1.0) -> NETStandard.Library (>= 1.6.1) AgainTest (>= 1.0.0) -> NETStandard.Library (>= 1.6.0)

I select the high version in the project's property, but the warning continue.

  • What are all this version numbers?
  • How can I resolve this warning?
Sanket
  • 19,295
  • 10
  • 71
  • 82
vernou
  • 6,818
  • 5
  • 30
  • 58
  • 1
    Not sure if this is a bug, though there was another package in my dependencies that caused this, but even after removing it still showed some warning but it dissapeared from dotnet cli, which it was showing in yellow prior. I removed the EFCore and others, uninstall. Deleted the bin and obj folders and did a restore from command line. Then re-added EntityFramework and the message disappeared. However it was never present on VS for Mac. Same tools version and project. There was a yellow warning icon over .net standard in VS SDK but no message. That is gone now. odd and unpredictable. – Eric Kelly Feb 18 '17 at 23:41

2 Answers2

15

You can't change this from the GUI because this package is impliclity defined from your TargetFramework. To change the version of NETStandard.Library package, add the following to your csproj file.

<PropertyGroup>
  <NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
</PropertyGroup>
natemcmaster
  • 25,673
  • 6
  • 78
  • 100
8

Adding the following to your csproj also seems to work:

<ItemGroup>
    <PackageReference Update="NETStandard.Library" Version="1.6.1" />
</ItemGroup>
schnitty
  • 416
  • 4
  • 12
  • What is the difference? – vernou Feb 20 '17 at 07:28
  • Practically in the context of your question probably nothing. The first answer is the way to declare a different version of the NetStandard package given that they are now implicit instead of explicit. The second way is a more general way to update any package to a different version so can be applied to other packages as well, not just NetStandard – schnitty Feb 20 '17 at 07:39