在TFS版本中找不到NuGet软件包版本?

时间:2020-06-15 15:07:24

标签: tfs nuget tfsbuild nuget-package-restore build-agent

我正在使用TFS 2017和NuGet安装程序-0任务以在构建定义中还原NuGet,但出现错误无法找到版本

它使用下面的命令来恢复软件包

D:\agent\_work\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe restore -NonInteractive D:\agent\_work\42\s\xyz\xyz.sln -Verbosity Detailed

Unable to find version '3.2.7' of package 'Microsoft.AspNet.WebPages'.
2020-06-15T14:50:36.6499535Z Unable to find version '5.2.7' of package 'Microsoft.AspNet.WebApi.WebHost'.
2020-06-15T14:50:36.6499535Z Unable to find version '5.2.7' of package 'Microsoft.AspNet.WebApi.Core'.
2020-06-15T14:50:36.6499535Z Unable to find version '5.2.7' of package 'Microsoft.AspNet.WebApi.Client'.
2020-06-15T14:50:36.6499535Z Unable to find version '5.2.7' of package 'Microsoft.AspNet.Mvc'.

但是当我在代理上手动运行与上述命令相同的命令时,它工作正常,还尝试更新NuGet任务版本。

2 个答案:

答案 0 :(得分:4)

无法找到软件包xxx的版本“ 3.2.7”

同意Etienne。这些软件包的版本可以在 <LinearLayout android:layout_width="match_parent" android:orientation="vertical" android:layout_alignParentBottom="true" android:weightSum="1" android:layout_height="wrap_content"> <Button android:layout_weight="1" android:id="@+id/snow" android:layout_width="match_parent" android:layout_height="60dp" android:textAllCaps="false" android:layout_alignParentBottom="true" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:layout_marginBottom="8dp" android:text="Want a Samyata Personal Shopper to find it for you?" android:textAlignment="center" android:background="#909be7" android:textColor="#ffffff" android:fontFamily="@font/poppinsmedium" android:textSize="18sp" android:visibility="gone" /> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/listcount" android:layout_width="30dp" android:layout_height="40dp" android:background="@drawable/bag" /> <TextView android:layout_toRightOf="@+id/listcount" android:layout_marginLeft="-10dp" android:background="@drawable/circle_red" android:id="@+id/text_count" android:paddingLeft="10dp" android:paddingRight="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="0 Items in cart" android:textColor="@color/black" /> </RelativeLayout> </LinearLayout> 中找到。

在TFS2017中使用nuget.org时,可以尝试以下方法来使用nuget.org。

  1. 使用Nuget Restore task V1。选择Nuget Restore task选项。

enter image description here

  1. 如果使用nuget.config文件,则可以在文件中添加Use Packages from nuget.org软件包源。

    nuget.config

这是有关nuget.config file的文档。

希望这会有所帮助。

答案 1 :(得分:2)

自今天早上(2020年6月16日)以来,我们的一个项目遇到了同样的问题,我们需要升级Nuget.exe。 我可以看到您正在使用Nuget 3.3,当前推荐的版本是5.5.1。

它似乎是由npm软件包安装的。

D:\agent\_work\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe

最新版本在这里: https://www.nuget.org/downloads

替换为最新的稳定版本即可。 ?

编辑: 旧的Nuget版本不再起作用的原因是因为GitHub放弃了对TLS 1.0和1.1的支持。

https://i.stack.imgur.com/ZN9sF.png (can't submit pictures yet)

相关问题