Nuget 包还原在 TFS 2015 中不起作用 [英] Nuget Package Restore Not Working In TFS 2015

查看:25
本文介绍了Nuget 包还原在 TFS 2015 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 TFS 2015 RC2 和带有 Visual Studio 2015 的构建服务器,Nuget 包还原对我们来说根本不起作用.我有一个 Visual Studio 构建任务,其中选中了还原 Nuget 包",但该步骤之前没有进行任何还原开始构建,然后失败.没有任何错误或任何东西可以让我暗示什么是错误的.没有关于包恢复的输出.我还尝试添加一个 nuget 包还原步骤,尽管它看起来是多余的,但这也没有任何作用.没有输出.构建代理日志如下所示:

23:02:49.826405 PowerShellHandler.Execute - AddCommand(C:\TFSAgent\tasks\NuGetInstaller\0.1.11\NuGetInstaller.ps1)23:02:49.826405 PowerShellHandler.Execute - 添加 inputParameters23:02:49.826405 PowerShellHandler.Execute - AddParameter(solution=C:\TFSAgent\_work\9c9a7daa\HiFxApi\main\src\HiFX.Api.sln)23:02:49.826405 PowerShellHandler.Execute - AddParameter(excludeVersion=false)23:02:49.826405 PowerShellHandler.Execute - AddParameter(noCache=false)23:02:49.826405 PowerShellHandler.Execute - AddParameter(nuGetRestoreArgs=)23:02:49.826405 PowerShellHandler.Execute - AddParameter(nuGetPath=)23:02:50.074443 PowerShellHandler.Execute - 调用23:02:50.275946 FindFiles.FindMatchingFiles(rootFolder = , matchPattern = C:\TFSAgent\_work\9c9a7daa\HiFxApi\main\src\**\packages.config, includeFiles = True, includeFolders = False23:02:50.275946 FindFiles.GetMatchingItems(includePatterns.Count = 1, excludePatterns.Count = 0, includeFiles = True, includeFolders = False23:02:50.291644 FindFiles.FindMatchingFiles - 找到 0 个匹配项23:02:50.322449 BaseLogger.LogStatus(scope.JobId = e0495eb1-3867-4bdf-8c90-196620cc0e1d,scope.TimelineRecordId = 6ac5c739-f581-4081-9cab-140-record)23:02:50.322449 BaseLogger.LogFile(scope.JobId = e0495eb1-3867-4bdf-8c90-196620cc0e1d,路径= C:\TFSAgent\_diag\w2ec95c01-f3c6-4db4-20d40c6-4db4-b910c23:02:50.322449 JobExtensionManager.OnAfterExecuteTask23:02:50.322449 BaseLogger.LogStatus(scope.JobId = e0495eb1-3867-4bdf-8c90-196620cc0e1d,scope.TimelineRecordId = 6ac5c739-f581-4081-9cab-140-record)23:02:50.322449 BaseLogger.LogConsoleMessage(scope.JobId = e0495eb1-3867-4bdf-8c90-196620cc0e1d, message = ##[section]完成任务:NuGetInstaller)23:02:50.322449 LoggingEventHandlerManager.LoadLoggingEventHandlers(pluginPath=)

我是否应该在我的解决方案中签入一个 packages.config 文件?

解决方案

您说得对,您需要将 packages.config 提交到您的 VCS.它包含解决方案中使用的软件包列表(+ 它们的版本和目标框架).

FindFiles.FindMatchingFiles - 在您的日志中找到 0 个匹配项 提示构建代理查找了 packages.config 文件,但没有找到,因此假设没有要恢复的内容,并在没有错误的情况下退出.>

Nuget package restore is not working at all for us with TFS 2015 RC2 and a build server with Visual Studio 2015. I have a Visual Studio Build task with "Restore Nuget Packages" checked but that step doesn't do any restore before starting the build, which then fails. There is no error or anything that gives me a hint what would be wrong. There is just no ouptut regarding the package restore. I also tried adding a nuget package restore step, despite it seeming redundant but that also doesn't do anything. No ouptut. The build agent log looks like this:

23:02:49.826405 PowerShellHandler.Execute - AddCommand(C:\TFSAgent\tasks\NuGetInstaller\0.1.11\NuGetInstaller.ps1)
23:02:49.826405 PowerShellHandler.Execute - Add inputParameters
23:02:49.826405 PowerShellHandler.Execute - AddParameter(solution=C:\TFSAgent\_work\9c9a7daa\HiFxApi\main\src\HiFX.Api.sln)
23:02:49.826405 PowerShellHandler.Execute - AddParameter(excludeVersion=false)
23:02:49.826405 PowerShellHandler.Execute - AddParameter(noCache=false)
23:02:49.826405 PowerShellHandler.Execute - AddParameter(nuGetRestoreArgs=)
23:02:49.826405 PowerShellHandler.Execute - AddParameter(nuGetPath=)
23:02:50.074443 PowerShellHandler.Execute - Invoke

23:02:50.275946 FindFiles.FindMatchingFiles(rootFolder = , matchPattern = C:\TFSAgent\_work\9c9a7daa\HiFxApi\main\src\**\packages.config, includeFiles = True, includeFolders = False
23:02:50.275946 FindFiles.GetMatchingItems(includePatterns.Count = 1, excludePatterns.Count = 0, includeFiles = True, includeFolders = False
23:02:50.291644 FindFiles.FindMatchingFiles - Found 0 matches
23:02:50.322449 BaseLogger.LogStatus(scope.JobId = e0495eb1-3867-4bdf-8c90-196620cc0e1d, scope.TimelineRecordId = 6ac5c739-f581-4081-9cab-1404f28bfcc3, record.Name = )
23:02:50.322449 BaseLogger.LogFile(scope.JobId = e0495eb1-3867-4bdf-8c90-196620cc0e1d, path = C:\TFSAgent\_diag\w2ec95c01-f3c6-4db4-b910-0d40c922051b.log)
23:02:50.322449 JobExtensionManager.OnAfterExecuteTask
23:02:50.322449 BaseLogger.LogStatus(scope.JobId = e0495eb1-3867-4bdf-8c90-196620cc0e1d, scope.TimelineRecordId = 6ac5c739-f581-4081-9cab-1404f28bfcc3, record.Name = )
23:02:50.322449 BaseLogger.LogConsoleMessage(scope.JobId = e0495eb1-3867-4bdf-8c90-196620cc0e1d, message = ##[section]Finishing task: NuGetInstaller)
23:02:50.322449 LoggingEventHandlerManager.LoadLoggingEventHandlers(pluginPath=)

Am I supposed to have a packages.config file checked in with my solution?

解决方案

You're right, you need to submit packages.config to your VCS. It contains a list of packages (+ their version & target framework) used in the solution.

FindFiles.FindMatchingFiles - Found 0 matches in your log hints that the build agent looked for packages.config files, found none and therefore assumed there is nothing to restore and exited without an error.

这篇关于Nuget 包还原在 TFS 2015 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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