1

我下载了 Nuget Web 应用程序的标准副本,并计划在我们的企业环境中使用它。我们使用 TFS 2010 来促进从本地计算机构建。当我在 TFS 上为 Nuget 排队新构建时,构建失败并出现错误:

默认情况下禁用包还原。要同意,请打开 Visual Studio 选项对话框,单击包管理器节点并选中“允许 NuGet 在构建期间下载丢失的包”。您还可以通过将环境变量“EnableNuGetPackageRestore”设置为“true”来表示同意。

问题:我是否需要在 TFS 构建服务器或 Visual Studio 的本地计算机上执行上面所说的操作?我该如何解决这个问题?如果这实际上是 TFS 构建服务器上的问题,并且构建服务器不允许下载丢失的包,我是否需要只下载这些包并将它们签入源代码控制?

这是构建产生的日志文件,其中也包含错误:

构建于 2013 年 9 月 19 日下午 12:19:08 开始。1> 节点 1 上的项目“F:\Builds\2\Nuget\NuGetGallery\Sources\NuGetGallery.sln”(默认目标)。1>ValidateSolutionConfiguration:构建解决方案配置“Release|Any CPU”。1>项目“F:\Builds\2\Nuget\NuGetGallery\Sources\NuGetGallery.sln”(1)正在构建“F:\Builds\2\Nuget\NuGetGallery\Sources\Website\Website.csproj”(2)节点 1(默认目标)。2>RestorePackages: "F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\nuget.exe" 安装 "F:\Builds\2\Nuget\NuGetGallery\Sources\Website\packages.config" -o "F: \Builds\2\Nuget\NuGetGallery\Sources\packages" 1>Project "F:\Builds\2\Nuget\NuGetGallery\Sources\NuGetGallery.sln" (1) 正在构建“F: \Builds\2\Nuget\NuGetGallery\Sources\Facts\Facts.csproj" (3) 在节点 2 上(默认目标)。 3>RestorePackages: "F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\nuget. exe" 安装 "F:\Builds\2\Nuget\NuGetGallery\Sources\Facts\packages.config" -o "F:\Builds\2\Nuget\NuGetGallery\Sources\packages" 2>F:\Builds\2\ Nuget\NuGetGallery\Sources.nuget\NuGet.targets(6,9):错误:默认情况下禁用包还原。要同意,请打开 Visual Studio 选项对话框,单击包管理器节点并选中“允许 NuGet 下载丢失构建过程中的软件包。您也可以通过将环境变量“EnableNuGetPackageRestore”设置为“true”来表示同意。[F:\Builds\2\Nuget\NuGetGallery\Sources\Website\Website.csproj] 2>F: \Builds\2\Nuget\NuGetGallery\Sources.nuget\NuGet.targets(6,9): error MSB3073: The command ""F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\nuget.exe" install " F:\Builds\2\Nuget\NuGetGallery\Sources\Website\packages.config" -o "F:\Builds\2\Nuget\NuGetGallery\Sources\packages"" 退出,代码为 1。 [F:\Builds\2 \Nuget\NuGetGallery\Sources\Website\Website.csproj] 2>Done Building Project "F:\Builds\2\Nuget\NuGetGallery\Sources\Website\Website.csproj"(默认目标)——失败。3>F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\NuGet.targets(6,9): 错误:默认情况下禁用包还原。要同意,请打开 Visual Studio 选项对话框,单击包管理器节点并选中“允许 NuGet 在构建期间下载丢失的包”。您还可以通过将环境变量“EnableNuGetPackageRestore”设置为“true”来表示同意。[F:\Builds\2\Nuget\NuGetGallery\Sources\Facts\Facts.csproj] 3>F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\NuGet.targets(6,9):错误 MSB3073:命令 ""F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\nuget.exe" 安装 "F:\Builds\2\Nuget\NuGetGallery\Sources\Facts\packages.config" -o "F:\Builds \2\Nuget\NuGetGallery\Sources\packages"" 退出并显示代码 1。 [F:\Builds\2\Nuget\NuGetGallery\Sources\Facts\Facts.csproj] 3>Done Building Project "F:\Builds\2\ Nuget\NuGetGallery\Sources\Facts\Facts.csproj”(默认目标)——失败。1>完成构建项目“F:\Builds\2\Nuget\NuGetGallery\Sources\NuGetGallery.sln”

构建失败。

   "F:\Builds\2\Nuget\NuGetGallery\Sources\NuGetGallery.sln" (default target) (1) ->
   "F:\Builds\2\Nuget\NuGetGallery\Sources\Website\Website.csproj" (default target) (2) ->
   (RestorePackages target) -> 
     F:\Builds\2\Nuget\NuGetGallery\Sources\.nuget\NuGet.targets(6,9):

错误:默认情况下禁用包还原。要同意,请打开 Visual Studio 选项对话框,单击包管理器节点并选中“允许 NuGet 在构建期间下载丢失的包”。您还可以通过将环境变量“EnableNuGetPackageRestore”设置为“true”来表示同意。[F:\Builds\2\Nuget\NuGetGallery\Sources\Website\Website.csproj] F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\NuGet.targets(6,9):错误 MSB3073:命令“ "F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\nuget.exe" 安装 "F:\Builds\2\Nuget\NuGetGallery\Sources\Website\packages.config" -o "F:\Builds\2 \Nuget\NuGetGallery\Sources\packages"" 退出并显示代码 1。 [F:\Builds\2\Nuget\NuGetGallery\Sources\Website\Website.csproj]

   "F:\Builds\2\Nuget\NuGetGallery\Sources\NuGetGallery.sln" (default target) (1) ->
   "F:\Builds\2\Nuget\NuGetGallery\Sources\Facts\Facts.csproj" (default target) (3) ->
     F:\Builds\2\Nuget\NuGetGallery\Sources\.nuget\NuGet.targets(6,9):

错误:默认情况下禁用包还原。要同意,请打开 Visual Studio 选项对话框,单击包管理器节点并选中“允许 NuGet 在构建期间下载丢失的包”。您还可以通过将环境变量“EnableNuGetPackageRestore”设置为“true”来表示同意。[F:\Builds\2\Nuget\NuGetGallery\Sources\Facts\Facts.csproj] F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\NuGet.targets(6,9):错误 MSB3073:命令“ "F:\Builds\2\Nuget\NuGetGallery\Sources.nuget\nuget.exe" 安装 "F:\Builds\2\NuGet\NuGetGallery\Sources\Facts\packages.config" -o "F:\Builds\2 \Nuget\NuGetGallery\Sources\packages"" 退出并显示代码 1。 [F:\Builds\2\Nuget\NuGetGallery\Sources\Facts\Facts.csproj]

0 Warning(s)
4 Error(s)

经过时间 00:00:00.82

4

0 回答 0