nuget未在Visual Studio Team Services(visualstudio.com)下下载软件包(自动软件包还原) [英] nuget not downloaded packages under Visual Studio Team Services (visualstudio.com) (Automatic Package Restore)

查看:188
本文介绍了nuget未在Visual Studio Team Services(visualstudio.com)下下载软件包(自动软件包还原)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很讨厌nuget并在Visual Studio Team Services(visualstudio.com)下构建解决方案.任何帮助将不胜感激.

I am really going nuts here with nuget and building a solution under Visual Studio Team Services (visualstudio.com). Any help will be much appreciated.

我有一个包含36个项目的解决方案.许多项目使用相同的5或6个nuget包.我已经仔细遵循迁移与MSBuild集成的解决方案以使用自动打包的说明恢复,因此在我的解决方案文件夹下有一个.nuget文件夹,其中包含一个唯一的NuGet.Config文件,不再包含Nuget.exe或Nuget.targets文件.所有项目均已删除其Nuget.targets行.

I have a solution containing 36 projects. Many projects use the same 5 or 6 nuget packages. I have carefully followed instructions for Migrating MSBuild-Integrated solutions to use Automatic Package Restore and therefore have a .nuget folder under my solution folder which contains a sole NuGet.Config file and no longer contains Nuget.exe or Nuget.targets files. All projects have had their Nuget.targets lines removed.

我使用的是Visual Studio 2013 Professional(v12更新2),该解决方案在本地构建,没有错误或警告.即使清理并删除了packages文件夹,它也可以下载并正常构建.未将packages文件夹签入Visual Studio Team Services.

I am using Visual Studio 2013 Professional (v12 Update 2) and the solution builds locally without errors or warnings. Even after a Clean and deletion of the packages folder it downloads and builds fine. The packages folder is NOT checked into Visual Studio Team Services.

检查构建日志表明:

  1. nuget并没有在构建开始时就启动来检查,下载和解压缩所有未解决的软件包(它是在从MSBuild-Integrated迁移到自动软件包还原之前进行的-尽管尽管如此,它并没有能够解析引用)
  2. 我面临着113个错误,重点是项目无法解析引用.
  3. 与本地构建(和MSBuild集成)不同,Visual Studio Team Services现在甚至没有在其构建日志中提及 nuget!
  1. nuget did not kick in at the start of the Build in order to check for, download and unpack any unresolved packages (it was doing this before migrating from MSBuild-Integrated to Automatic Package Restore - however despite that, it wasn't able to resolve references)
  2. I am left with 113 errors, centred around the fact that projects were unable to resolve references.
  3. Unlike a local build (and MSBuild-Integrated), Visual Studio Team Services now doesn't even mention nuget in its build log!!!

日志开始失败的示例(尽管这显然是因为nuget尚未介入):

An example of the log where things start to fail (although this is obviously because nuget hasn't stepped in):

Project "C:\a\src\TFS\RSPlatform\Main\Source\RSPlatform Team Project.sln" (1) is building "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\A2Refresh.csproj" (8) on node 1 (default targets).
PrepareForBuild:
  Creating directory "obj\Release\".
ResolveAssemblyReferences:
  Primary reference "Bytescout.Spreadsheet".
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Bytescout.Spreadsheet". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\A2Refresh.csproj]
          For SearchPath "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\FakesAssemblies".
          Considered "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\FakesAssemblies\Bytescout.Spreadsheet.winmd", but it didn't exist.
          Considered "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\FakesAssemblies\Bytescout.Spreadsheet.dll", but it didn't exist.
          Considered "C:\a\src\TFS\RSPlatform\Main\Source\Support\A2Refresh\FakesAssemblies\Bytescout.Spreadsheet.exe", but it didn't exist.
          For SearchPath "{HintPathFromItem}".
          Considered "..\..\packages\Bytescout.Spreadsheet.2.4.0.1346\lib\net45\Bytescout.Spreadsheet.dll", but it didn't exist.
          For SearchPath "{TargetFrameworkDirectory}".
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Bytescout.Spreadsheet.winmd", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Bytescout.Spreadsheet.dll", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Bytescout.Spreadsheet.exe", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\Bytescout.Spreadsheet.winmd", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\Bytescout.Spreadsheet.dll", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\Facades\Bytescout.Spreadsheet.exe", but it didn't exist.
          For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.5.1,AssemblyFoldersEx}".
          Considered AssemblyFoldersEx locations.
          For SearchPath "{AssemblyFolders}".

有人可以建议我如何让Visual Studio Team Services使用nuget吗? 如果自动程序包还原建议删除~/.nuget/NuGet.exe,Visual Studio Team Services甚至应该如何使用NuGet?

Can anyone advise how I should get Visual Studio Team Services to use nuget? How is Visual Studio Team Services even suposed to use NuGet if Automatic Package Restore suggests dropping ~/.nuget/NuGet.exe?

预先感谢, 克里斯

推荐答案

如果您是基于Visual Studio Team Services构建的,那么我发现Nuget.exe和Nuget.targets都需要同时存在,这似乎与之相反通过搜索该主题可以找到所有建议.

If you are building on Visual Studio Team Services then I have found that both Nuget.exe and Nuget.targets need to be present, which seems to be contrary to all the advice you can find by googling this subject.

添加它们使我的Visual Studio Team Services构建正常工作.

Adding them in got my Visual Studio Team Services builds working.

这篇关于nuget未在Visual Studio Team Services(visualstudio.com)下下载软件包(自动软件包还原)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆