Azure DevOps 构建管道不再能够构建

问题描述 投票:0回答:1

管道 yaml 没有更改,现在尝试恢复和构建解决方案时失败。

这是记录的错误:

nuget 命令失败,退出代码 (1) 和错误(System.AggregateException:发生一个或多个错误。 ---> NuGet.CommandLine.CommandLineException:在 C: gent_work \s\Accuro3S.Algorithms 解析解决方案文件时出错.sln:NuGet.CommandLine.RestoreCommand 处的 NuGet.CommandLine.MsBuildUtility.GetAllProjectFileNamesWithMsBuild(String SolutionFile, String msbuildPath) 处的调用目标引发了异常。 .d__37.MoveNext() --- 抛出异常的上一个位置的堆栈跟踪结束 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 处 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 处NuGet.CommandLine.RestoreCommand.d__30.MoveNext() --- 内部异常堆栈跟踪结束 --- 在 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) 在 System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout) 、CancellationToken CancelToken) at NuGet.CommandLine.Command.Execute() at NuGet.CommandLine.Program.MainCore(StringworkingDirectory, String[] args) ---> (内部异常 #0) NuGet.CommandLine.CommandLineException: 错误解析解决方案文件位于 C: gent_work \s\Accuro3S.Algorithms.sln:调用目标已引发异常。在 NuGet.CommandLine.MsBuildUtility.GetAllProjectFileNamesWithMsBuild(String SolutionFile, String msbuildPath) 在 NuGet.CommandLine.RestoreCommand.ProcessSolutionFile(String SolutionFileFullPath, PackageRestoreInputs RestoreInputs) 在 NuGet.CommandLine.RestoreCommand.d__37.MoveNext() --- 堆栈跟踪结束先前抛出异常的位置 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 NuGet.CommandLine.RestoreCommand.d__30.MoveNext()<---)

我已经确认没有任何问题

Accuro3S.Algorithms.sln

如有任何建议,我们将不胜感激。

我尝试创建一个新的个人访问令牌。 我尝试在我的构建代理计算机上运行 .sln 的手动恢复,并且运行成功。

.net azure-devops azure-pipelines azure-pipelines-yaml
1个回答
0
投票

错误消息表明解析解决方案文件时出现问题,但您已确认解决方案文件本身不是问题。您提到的修复程序,下载特定版本的

nuget.exe
,似乎已经解决了问题,但您不确定为什么需要执行此步骤。

您可以查看NuGet Release Notes以了解此版本中修复的内容。例如,某些版本的

nuget.exe
可能包含您的特定设置或环境所需的修复或改进。对于您的情况,该版本可能已经解决了在恢复过程中导致错误的特定问题。您可以检查代码中是否有任何相关更改需要新版本的
nuget.exe

在管道中,您可以在使用 nuget 恢复任务之前使用 NuGetToolInstaller@1 任务安装特定版本的

nuget.exe

# NuGet tool installer v1
# Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this task to change the version of NuGet used in the NuGet tasks.
- task: NuGetToolInstaller@1
  inputs:
    versionSpec: '6.x' # string. Version of NuGet.exe to install. 
    checkLatest: false # boolean. Always check for new versions. Default: false.
© www.soinside.com 2019 - 2024. All rights reserved.