Azure devops 为什么Newtonsoft.json 12.0.2 nuget包无法使用TFS 2017 Update3中的nuget restore任务进行恢复?

Azure devops 为什么Newtonsoft.json 12.0.2 nuget包无法使用TFS 2017 Update3中的nuget restore任务进行恢复?,azure-devops,json.net,azure-pipelines-build-task,nuget-package-restore,Azure Devops,Json.net,Azure Pipelines Build Task,Nuget Package Restore,我在TFS 2017中创建了一个生成定义,该生成定义中配置了nuget restore任务,它试图从我们的私有nuget respository下载newtonsoft.json 12.0.2包,但无法恢复newtonsoft nuget包,只恢复package.config中提到的其他nuget包 我还复制了nuget还原任务的日志以供参考 =============================================================================

我在TFS 2017中创建了一个生成定义,该生成定义中配置了nuget restore任务,它试图从我们的私有nuget respository下载newtonsoft.json 12.0.2包,但无法恢复newtonsoft nuget包,只恢复package.config中提到的其他nuget包

我还复制了nuget还原任务的日志以供参考

==============================================================================
Task         : NuGet Installer
Description  : Installs or restores missing NuGet packages
Version      : 0.2.31
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)
==============================================================================

C:\Windows\system32\chcp.com 65001
Active code page: 65001
Detected NuGet version 3.3.0.212 / 3.3.0
SYSTEMVSSCONNECTION exists true

C:\PoC\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe restore -NonInteractive C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\MatchWebSolution.sln -NoCache
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
Feeds used:
  http://vwmazpronuget:81/nuget/Common

Restoring NuGet package Microsoft.Web.Infrastructure.1.0.0.
Restoring NuGet package ePI.STeP.Message.load.Rec.1.0.0.
Adding package 'Microsoft.Web.Infrastructure.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Adding package 'ePI.STeP.Message.load.Rec.1.0.0. to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Added package 'Microsoft.Web.Infrastructure.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Added package 'ePI.STeP.Message.load.Rec.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Restoring NuGet package Match.Common.Rec.1.0.0.
Restoring NuGet package Match.Payload.PI.1.0.0.
Restoring NuGet package MATCH.Rec.ThirdPartyComponents.1.0.0.
Adding package 'Match.Payload.PI.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Added package 'Match.Payload.PI.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Adding package 'Match.Common.Rec.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Restoring NuGet package Newtonsoft.Json.12.0.2.
Added package 'Match.Common.Rec.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
WARNING: Unable to find version '12.0.2' of package 'Newtonsoft.Json'.
Adding package 'MATCH.Rec.ThirdPartyComponents.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Added package 'MATCH.Rec.ThirdPartyComponents.1.0.0' to folder 'C:\PoC\1\s\Rec\Main-Rec\Web\MatchWebApp\packages'
Unable to find version '12.0.2' of package 'Newtonsoft.Json'.

Error: C:\PoC\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1

Packages failed to install

******************************************************************************

Finishing: NuGet restore $(build.sourcesdirectory)/Rec\Main-Rec\Web\MatchWebApp\MatchWebSolution.sln
Package.config文件-

<?xml version="1.0" encoding="utf-8"?>
<packages>
    <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
    <package id="ePI.STeP.Message.load.Rec" version="1.0.0" />
    <package id="Match.Common.Rec" version="1.0.0" />
    <package id="Match.Payload.PI" version="1.0.0" />
    <package id="MATCH.Rec.ThirdPartyComponents" version="1.0.0" />
     <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net40" />
</packages>

问题已经解决,我在构建任务中使用了nuget.exe版本3.3.0,我认为它与Newtonsoft.json 12.0.2不兼容。 当我在Nuget还原任务中选择Nuget.exe版本3.5.0时,它开始从我们的提要下载Newtonsoft.json 12.0.2 Nuget包。 还请注意,nuget 3.5.0需要执行MSBuild 14.0


谢谢。

12.0.2版存在于源中?是的,它确实存在,甚至在我使用visual studio手动生成解决方案时被下载。@SRP,您确定成功下载的包来自源吗?下载包时,您可以使用工具Fiddler跟踪http请求。@Lu Mike,是的,VS正在从我们的私有源下载它,因为我已取消选中其他nuget源,甚至TFS生成也正在下载路径为“C:\Users\TFS\U service\AppData\Local\nuget\Cache”的.nupkg文件文件夹,但无法将其下载到包文件夹中,在包文件夹中下载并复制所有其他nuget。@SRP,此问题是否仍然存在?如果是这样,请尝试使用本地计算机使用私有代理运行此生成?