Nuget在VSTS中还原失败

4
我的解决方案在VS2017和VisualStudioVersion = 14.0.25420中编译成功。但是,在VSTS构建定义中,Nuget还原失败了。已经执行了以下步骤:enter image description hereenter image description hereenter image description here我已经参考了下面的链接并尝试执行它们,但仍然抛出相同的错误:在构建中使用最新的NuGet。仍然没有运气。

详细日志:
2018-03-16T08:30:20.9863624Z任务:NuGet
2018-03-16T08:30:20.9863815Z描述:还原、打包或推送NuGet包,或运行NuGet命令。支持NuGet.org和像Package Management和MyGet这样的身份验证提要。使用NuGet.exe并与.NET Framework应用程序一起工作。对于.NET Core和.NET Standard应用程序,请使用.NET Core任务。
2018-03-16T08:30:20.9863996Z版本:2.0.24
2018-03-16T08:30:20.9864098Z作者:Microsoft Corporation
2018-03-16T08:30:20.9864232Z帮助:更多信息
2018-03-16T08:30:20.9864356Z==================================================
2018-03-16T08:30:23.3611981Z缓存工具:NuGet 4.1.0 x64
2018-03-16T08:30:23.3717038Z在缓存中找到工具:NuGet 4.1.0 x64
2018-03-16T08:30:23.3790881Z从工具缓存中解析:4.1.0
2018-03-16T08:30:23.3791208Z使用版本:4.1.0
2018-03-16T08:30:23.3794629Z在缓存中找到工具:NuGet 4.1.0 x64
2018-03-16T08:30:23.4907509Z[command]C:\Windows\system32\chcp.com 65001

2018-03-16T08:30:23.5489365Z 活动代码页:65001

2018-03-16T08:30:23.5831075Z 检测到NuGet版本为4.1.0.2450 / 4.1.0

2018-03-16T08:30:23.5953230Z SYSTEMVSSCONNECTION 存在为真

2018-03-16T08:30:23.5976398Z 将NuGet.config保存到临时配置文件中。

2018-03-16T08:30:23.6021481Z [command]D:\a_tool\NuGet\4.1.0\x64\nuget.exe sources Add -NonInteractive -Name NuGetOrg -Source https://api.nuget.org/v3/index.json -ConfigFile D:\a\1\Nuget\tempNuGet_13.config

2018-03-16T08:30:26.0565743Z 成功添加名称为NuGetOrg的包源。

2018-03-16T08:30:26.0571052Z 将NuGet.config保存到临时配置文件中。

2018-03-16T08:30:26.0704297Z [command]D:\a_tool\NuGet\4.1.0\x64\nuget.exe restore D:\a\ts.sln -Verbosity Detailed -NonInteractive -ConfigFile D:\a\1\Nuget\tempNuGet_13.config

2018-03-16T08:30:29.9861727Z NuGet版本:4.1.0.2450

2018-03-16T08:30:29.9862227Z MSBuild自动检测:使用来自“C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin”的msbuild版本“15.6.82.30579”。使用选项-MSBuildVersion强制nuget使用特定版本的MSBuild。

2018-03-16T08:30:29.9863068Z System.AggregateException:发生了一个或多个错误。 ---> NuGet.CommandLine.CommandLineException:在D:\a\ts.sln处解析解决方案文件时出错:已针对调用目标引发异常。

2018-03-16T08:30:29.9868970Z at NuGet.CommandLine.MsBuildUtility.GetAllProjectFileNamesWithMsBuild(String solutionFile, String msbuildPath)

2018-03-16T08:30:29.9869367Z at NuGet.CommandLine.RestoreCommand.ProcessSolutionFile(String solutionFileFullPath, PackageRestoreInputs restoreInputs)

2018-03-16T08:30:29.9869611Z at NuGet.CommandLine.RestoreCommand.d__37.MoveNext()

2018-03-16T08:30:29.9869813Z --- 在上一个引发异常的位置结束堆栈跟踪 ---

2018-03-16T08:30:29.9869995Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

2018-03-16T08:30:29.9870166Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

2018-03-16T08:30:29.9870995Z at NuGet.CommandLine.RestoreCommand.d__30.MoveNext()

2018-03-16T08:30:29.9871164Z --- 内部异常堆栈跟踪结束 ---

2018-03-16T08:30:30.0446275Z ##[error]Nuget命令以退出代码(1)和错误(System.AggregateException: 发生了一个或多个错误。---> NuGet.CommandLine.CommandLineException: 解析D:\a\ts.sln解决方案文件时出错:目标调用引发了异常。 at NuGet.CommandLine.MsBuildUtility.GetAllProjectFileNamesWithMsBuild(String solutionFile, String msbuildPath) at NuGet.CommandLine.RestoreCommand.ProcessSolutionFile(String solutionFileFullPath, PackageRestoreInputs restoreInputs) at NuGet.CommandLine.RestoreCommand.d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.CommandLine.RestoreCommand.d__30.MoveNext() --- 内部异常堆栈跟踪结束 --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at NuGet.CommandLine.Command.Execute() at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args) ---> (Inner Exception #0) NuGet.CommandLine.CommandLineException: 解析D:\a\ts.sln解决方案文件时出错:目标调用引发了异常。 at NuGet.CommandLine.MsBuildUtility.GetAllProjectFileNamesWithMsBuild(String solutionFile, String msbuildPath) at NuGet.CommandLine.RestoreCommand.ProcessSolutionFile(String solutionFileFullPath, PackageRestoreInputs restoreInputs) at NuGet.CommandLine.RestoreCommand.d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.CommandLine.RestoreCommand.d__30.MoveNext()<---)

2018-03-16T08:30:30.0459326Z ##[error]包恢复失败

2018-03-16T08:30:30.0477190Z ##[section]完成: NuGet恢复


1
配置看起来没问题,似乎是你的sln文件有点奇怪。最后一张截图中错误信息被截断了,但这看起来像是这个问题 -> https://dev59.com/i1oV5IYBdhLWcg3wCrHH - D.J.
看起来你正在使用托管的 VS2017 代理。如果您的项目是在 VS2015 中开发的,请改用托管代理,并使用NuGet 3.5。或者您可以在OneDrive上共享您的解决方案吗? - Marina Liu
@Amruta,你能展示一下你的VSTS构建详细日志吗? - Marina Liu
@Marina - 我的VS2015项目构建已成功执行。但是VS2017项目仍然存在问题。我已添加了详细日志。 - Amruta
相关 - https://dev59.com/PFcO5IYBdhLWcg3w5lUM#45100595 - sashoalm
显示剩余7条评论
1个回答

4

1
这对我们来说是解决方案。但这在一周内发生了两次。希望他们尽快修复根本原因。 - Sam

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接