繁体   English   中英

为什么Newtonsoft.json 12.0.2 nuget程序包无法使用TFS 2017 Update3中的Nuget Restore任务还原?

[英]Why does the Newtonsoft.json 12.0.2 nuget package fails to restore using Nuget Restore task in TFS 2017 Update3?

我在TFS 2017中创建了一个构建定义,并且此构建定义中配置了nuget restore任务,该任务试图从我们的私有nuget存储库中下载newtonsoft.json 12.0.2程序包,但无法还原newtonsoft nuget程序包并且仅还原package.config中也提到的其他nuget软件包。

我已经复制了nuget restore任务的日志以及参考。

==============================================================================
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时,它开始从Feed中下载Newtonsoft.json 12.0.2 nuget程序包。 还要注意,nuget 3.5.0需要MSBuild 14.0才能执行。

谢谢。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM