VSTS build: Packages failed to restore - Unable to resolve 'NETStandard.Library (>= 1.6.1)' for '.NETStandard,Version=v2.0'

懵懂的女人 提交于 2019-11-30 01:47:04

Update 18/09/2017

Step 2 is no longer needed. I've left it in the solution though as it may still help some people. Thanks, @Liero for point this out.


Original Answer

I've just experienced this problem too and solved it by doing three things:

  1. Use the .NET Core SDK(! - not runtime!) version 2.0.0:

  2. Use the latest NuGet feed (4.3.0):

  3. Restore your packages:

Update It's worth mentioning here that you should specify where you get your NuGet packages from. Most applications will probably just use the NuGet.org feed, as per the screenshot (see small checkbox), but you may have your custom feeds specified in a NuGet.config file. In that case, tick 'Feeds in my NuGet.config' and then specify the path to that file.

To illustrate the order, this is my working queue:

I hope this helps you and anyone else who has come up against this problem. If you have any questions, let me know. :)

You should select Feed(s) I select here for Feeds to use option. If you leave Use packages from this VSTS/TFS feed empty, packages will be downloaded from https://dist.nuget.org/.

Else, if you want to use Feeds in my NuGet.config as Feeds to use, you should specify the path for your NuGet.config file.

I have received a similar error after generating a project using dotnet new angular which created a project relying on netcoreapp2.0. Inspection of project properties revealed that version 2.0 was not properly recognized (did not appear in the installed framework list).

Solution was to update Visual Studio 2017, as the minimum version required to support netcoreapp2.0 projects seems to be 15.3.1.

What worked for me was installing .NET Core SDK 2.0 and making the following changes:

in .csproj:

change

<TargetFramework>netcoreapp1.1.0</TargetFramework>

to

<TargetFramework>netcoreapp2.0</TargetFramework>

and in global.json:

"sdk": { "version": "1.1.0" }

to

"sdk": { "version": "2.0.0" }

I didn't know how to use Chris Paton' solution

Updating the Visual Studio 2017 to latest 15.4.1 version resolved the problem for me.

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