简体   繁体   English

管道上调用的目标已引发异常

[英]Exception has been thrown by the target of an invocation on a pipeline

I've created a build pipeline for a .NET Framework project.我为 .NET 框架项目创建了一个构建管道。 When the pipeline is triggered by a pull request, I've got this errors on the task: 'NuGet restore'当管道由拉取请求触发时,我在任务中遇到此错误:'NuGet restore'

  • ##[error]The nuget command failed with exit code(1) and error(Error parsing solution file at d:\a\1\s\***.sln : Exception has been thrown by the target of an invocation. The project file could not be loaded. Could not load file or assembly Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a or one of its dependencies. The system cannot find the file specified. d:\a\1\s\***.sln ) ##[错误]nuget 命令失败,退出代码 (1) 和错误(解析解决方案文件位于d:\a\1\s\***.sln时出错:调用目标已引发异常。无法加载项目文件。无法加载文件或程序集Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a或其依赖项之一。系统找不到指定的文件d:\a\1\s\***.sln )

  • ##[error]Packages failed to restore ##[error]包恢复失败

When I try to compile the solution on my local computer after merging with the target branch, I don't have any conflicts or errors.当我尝试在与目标分支合并后在本地计算机上编译解决方案时,我没有任何冲突或错误。

Here is my YML file:这是我的 YML 文件:

pool:
  name: Hosted Windows 2019 with VS2019
  demands:
  - msbuild
  - visualstudio
  - vstest

steps:
- task: NuGetToolInstaller@0
  displayName: 'Use NuGet 4.4.1'
  inputs:
    versionSpec: 4.4.1

- task: NuGetCommand@2 # --> This task fails.
  displayName: 'NuGet restore'
  inputs:
    restoreSolution: '***.sln'

- task: VSBuild@1
  displayName: 'Build solution'
  inputs:
    solution: '***.sln'
    platform: 'any cpu'
    configuration: 'release'

- task: PublishSymbols@2
  displayName: 'Publish symbols path'
  inputs:
    SearchPattern: '**\bin\**\*.pdb'
    PublishSymbols: false
  continueOnError: true

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact drop'
  inputs:
    PathtoPublish: ***
    ArtifactName: 'drop wa'

What's wrong with it?它出什么问题了?

There seems to be currently an issue with nuget task. nuget 任务目前似乎存在问题。 You might try to change version to 5.4 as that seems to solve it for some people, including me.您可能会尝试将版本更改为 5.4,因为这似乎可以解决包括我在内的某些人的问题。

Please see the link below: https://developercommunity.visualstudio.com/content/problem/978914/nuget-restore-on-hosted-agent-builds-cannot-find-s.html请查看以下链接: https://developercommunity.visualstudio.com/content/problem/978914/nuget-restore-on-hosted-agent-builds-cannot-find-s.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin 中的调用目标引发异常 - Exception has been thrown by the target of an invocation in Xamarin 出现错误异常(调用的目标已抛出异常。) - An error exception appears (Exception has been thrown by the target of an invocation.) Sys.WebForms.PageRequestManagerServerErrorException:调用目标抛出了异常 - Sys.WebForms.PageRequestManagerServerErrorException: Exception has been thrown by the target of an invocation 配置错误-调用目标已引发异常 - Configuration Error - Exception has been thrown by the target of an invocation DTS脚本任务运行时错误:调用目标已抛出异常 - DTS Script Task Runtime Error: Exception has been thrown by the target of an invocation 在VisualStudio中创建IronPython项目时出错; “调用的目标已引发异常。” - Error when creating an IronPython project in VisualStudio; “Exception has been thrown by the target of an invocation.” “调用的目标已抛出异常。” 尝试反序列化对象时 - “Exception has been thrown by the target of an invocation.” when trying to deserialize an object 调用目标抛出的 Epplus 异常 - Epplus Exception thrown by the target of invocation 如何解决:“调用目标引发了异常”C# - How to solve: “exception was thrown by the target of invocation” C# 内联函数的堆栈跟踪是否在抛出的异常中保留? - Is the stack trace of function that has been inlined preserved on a thrown exception?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM