VS 2017 RC : I Can not update NETStandard.Library in Nuget

眉间皱痕 提交于 2019-12-22 01:43:10

问题


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 :

In project's properties, the version is different :

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?

回答1:


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>



回答2:


Adding the following to your csproj also seems to work:

<ItemGroup>
    <PackageReference Update="NETStandard.Library" Version="1.6.1" />
</ItemGroup>


来源:https://stackoverflow.com/questions/42320021/vs-2017-rc-i-can-not-update-netstandard-library-in-nuget

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!