.net-core - TFS 构建代理在 : .Net Core + VS 2017 + 私有(private) TFS 源的 Nuget 还原上失败

标签 .net-core tfsbuild visual-studio-2017

我有:一个 .NET Core 应用程序,针对 VS 2017 进行了修改并使用了一个 TFS 提要。
当它在 VS 2015 时, NuGet restore 工作正常。
现在使用 VS 2017 , NuGet restore 它不起作用返回 Failed to load msbuild Toolset ... Could not load file or assembly 'Microsoft.Build, Version=14.0.0.0我也尝试使用 dotnet restore 并得到 401 (Unauthorized) 响应。
显然 NuGet restore 是首选方式,因为它自动为我们进行身份验证,以便使用 TFS Feed,但它似乎无法识别 VS 2017。
2017 年 3 月 20 日更新
很抱歉造成混淆,我忘了提到问题在于使用 CI/CD Visual Studio Team Services/Build。在我的电脑上,它运行良好,因为我有 NuGet 4(它与 VS 2017 一起提供)......但在线可用的 NuGet 版本(可以访问私有(private)提要)是:3.3 和 3.5
2017 年 3 月 25 日更新
在我按照@Cece-MSFT 的建议将 nuget 4.0 添加到构建中后,我仍然收到错误但没有太多细节。看截图:
enter image description here

最佳答案

您可以使用位于 %APPDATA%\NuGet\NuGet.Config 的构建服务器的 nuget 全局配置文件

关于.net-core - TFS 构建代理在 : .Net Core + VS 2017 + 私有(private) TFS 源的 Nuget 还原上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42849556/

相关文章:

c# - 在项目之间共享 Microsoft.Extensions.DependencyInjection.ServiceProvider 配置

powershell - TFS vNext build agent安装

c++ - CMake 库目标并不总是出现在 Visual Studio 2017 的启动项下拉列表中

tfsbuild - 是否可以将可移植类库 (PCL) 与 Visual Studio Online 托管构建服务器一起使用?

android - Cordova + Visual Studio + Android@7.0.0?

c# - 命名空间 'AzureAD' 中不存在类型或命名空间名称 'Microsoft.AspNetCore.Authentication'

c# - .NET Core Singleton Creation 被多次调用

.net - 如何将多个 .NET Core 程序集合并为一个(.dll/.exe)?

.net-core - .HttpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase 在 .net core 2.1 中不起作用?

tfs - 是否可以在任务或条件循环之间设置延迟