Mat*_*zer 17 tfs visual-studio nuget visual-studio-2015 tfs-2015
我在2015年TFS Build期间遇到了NuGet包恢复问题.
由于某些软件包需要NuGet 3.x客户端,因此我已将新的脚本化构建配置为使用自定义NuGet位置,其中我放置了NuGet Command-Line 3.x beta的可执行文件.
每当我运行构建时,所有软件包都无法恢复,NuGet会抛出"无法找到版本..."错误:
Unable to find version '1.1.10' of package 'Microsoft.Bcl'.
Unable to find version '4.0.10' of package 'System.Threading'.
Unable to find version '1.1.37' of package 'System.Collections.Immutable'.
Unable to find version '1.0.0' of package 'Owin'.
Unable to find version '4.1.0' of package 'NLog'.
Unable to find version '7.0.1' of package 'Newtonsoft.Json'.
Unable to find version '2.0.1' of package 'MongoDB.Driver.Core'.
Unable to find version '2.0.1' of package 'MongoDB.Driver'.
Unable to find version '2.0.1' of package 'MongoDB.Bson'.
Unable to find version '3.0.1' of package 'Microsoft.Owin.Security.OAuth'.
Run Code Online (Sandbox Code Playgroud)
......甚至更多的包裹.我相信问题很清楚.
当我使用Visual Studio在构建机器中构建相同的解决方案时,所有包都可以成功恢复.
我该如何解决这个问题?
Mat*_*zer 22
在我的情况下,问题是,用户范围NuGet.config位于C:\Users\[User name]\AppData\Roaming\NuGet\NuGet.config(这里[User name]是谁的运行生成代理的Windows服务的用户)指着的NuGet API第2 ,而我的积累已经在使用的NuGet命令行3.X.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<!-- CHANGING V2 TO V3 IN THE URI VALUE SOLVED THE ISSUE! -->
<add key="nuget.org" value="https://www.nuget.org/api/v3/" />
</packageSources>
</configuration>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18670 次 |
| 最近记录: |