gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 21:36:27 27 4
gpt4 key购买 nike

我明白了

Unable to resolve 'NETStandard.Library (>= 1.6.1)' for '.NETStandard,Version=v2.0'.

在将我的 aspnetcore 应用程序升级到 netcoreapp2.0 并将我的库升级到使用 netstandard2.0 后,使用 Hosted2017 构建代理进行 VSTS 构建。

在本地工作正常。

我已编辑构建定义以使用 .net core 构建任务v2.* 预览:

build definition details

这是构建日志:

Current agent version: '2.120.2'
Download all required tasks.
Downloading task: DotNetCoreCLI

Starting: Get Sources
Syncing repository: Liero/vyvojari-sk (GitHub)
...details ommited
HEAD is now at e448a25... Upgraded to .NET Core 2.0
Finishing: Get Sources

Starting: Restore
==============================================================================
Task : .NET Core
Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command. For package commands, supports NuGet.org and authenticated feeds like Package Management and MyGet.
Version : 2.0.5
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
==============================================================================
SYSTEMVSSCONNECTION exists true
Downloading: https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe
Caching tool: NuGet 4.0.0 x64
Using version: 4.0.0
Found tool in cache: NuGet 4.0.0 x64
Saving NuGet.config to a temporary config file.
Can\'t find loc string for key: NGCommon_NoSourcesFoundInConfig
NGCommon_NoSourcesFoundInConfig d:\a\1\Nuget\tempNuGet_734.config
"C:\Program Files\dotnet\dotnet.exe" restore d:\a\1\s\src\CommandStack\CommandStack.csproj --configfile d:\a\1\Nuget\tempNuGet_734.config --verbosity Detailed
Restoring packages for d:\a\1\s\src\CommandStack\CommandStack.csproj...
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Unable to resolve 'NETStandard.Library (>= 1.6.1)' for '.NETStandard,Version=v2.0'. [d:\a\1\s\src\CommandStack\CommandStack.csproj]
Generating MSBuild file d:\a\1\s\src\CommandStack\obj\CommandStack.csproj.nuget.g.props.
Generating MSBuild file d:\a\1\s\src\CommandStack\obj\CommandStack.csproj.nuget.g.targets.
Writing lock file to disk. Path: d:\a\1\s\src\CommandStack\obj\project.assets.json
Restore failed in 115.64 ms for d:\a\1\s\src\CommandStack\CommandStack.csproj.

Errors in d:\a\1\s\src\CommandStack\CommandStack.csproj
Unable to resolve 'NETStandard.Library (>= 1.6.1)' for '.NETStandard,Version=v2.0'.

NuGet Config files used:
d:\a\1\Nuget\tempNuGet_734.config
Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
Packages failed to restore
******************************************************************************
Finishing: Restore
******************************************************************************

这是源代码:https://github.com/Liero/vyvojari-sk/tree/e448a25fb8c481704e9102aaaeb8b84b9aee7b02

最佳答案

更新2017年9月18日

不再需要第 2 步。我已将其保留在解决方案中,因为它仍然可以帮助某些人。谢谢@Liero 指出这一点。

<小时/>

原始答案

我刚刚也遇到过这个问题,并通过做三件事解决了它:

  1. 使用 .NET Core SDK(!- 不是运行时!)版本 2.0.0: enter image description here

  2. 使用最新的 NuGet feed (4.3.0): enter image description here

  3. 恢复您的包: enter image description here

更新这里值得一提的是,您应该指定从哪里获取 NuGet 包。大多数应用程序可能只使用 NuGet.org 源,如屏幕截图所示(请参阅小复选框),但您可能在 NuGet.config 文件中指定了自定义源。在这种情况下,请勾选“在我的 NuGet.config 中提供源”,然后指定该文件的路径。

为了说明顺序,这是我的工作队列: enter image description here

我希望这对您和其他遇到此问题的人有所帮助。如果您有任何疑问,请告诉我。 :)

关于.net-core - VSTS 版本 : Packages failed to restore - Unable to resolve 'NETStandard.Library (>= 1.6.1)' for '.NETStandard,Version=v2.0' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45717283/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com