azure-devops - Dotnet 命令在单元测试套件上因非零退出代码而失败,没有明显的错误详细信息
问题描述
我正在运行一个单元测试套件,突然 dotnet 退出并出现错误但我看不到与什么相关的错误?
2020-09-28T14:45:44.4406132Z ##[error]Error: The process 'C:\ag2\_w\_tool\dotnet\dotnet.exe' failed with exit code 1
2020-09-28T14:45:45.0411575Z Result Attachments will be stored in LogStore
2020-09-28T14:45:45.0682638Z Run Attachments will be stored in LogStore
2020-09-28T14:45:45.1670771Z No Result Found to Publish 'C:\ag2\_w\_temp\bld_bc-dev-bld-01_2020-09-28_14_45_12.trx'.
2020-09-28T14:45:45.1766433Z No Result Found to Publish 'C:\ag2\_w\_temp\bld_bc-dev-bld-01_2020-09-28_14_45_27.trx'.
2020-09-28T14:45:45.1863176Z No Result Found to Publish 'C:\ag2\_w\_temp\bld_bc-dev-bld-01_2020-09-28_14_45_44.trx'.
2020-09-28T14:45:45.1889993Z Info: Azure Pipelines hosted agents have been updated to contain .Net Core 3.x (3.1) SDK/Runtime along with 2.1. Unless you have locked down a SDK version for your project(s), 3.x SDK might be picked up which might have breaking behavior as compared to previous versions.
2020-09-28T14:45:45.1890767Z Some commonly encountered changes are:
2020-09-28T14:45:45.1891763Z If you're using `Publish` command with -o or --Output argument, you will see that the output folder is now being created at root directory rather than Project File's directory. To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
2020-09-28T14:45:45.1893725Z ##[error]Dotnet command failed with non-zero exit code on the following projects :
2020-09-28T14:45:45.1924867Z ##[section]Async Command Start: Publish test results
2020-09-28T14:45:45.3885730Z Publishing test results to test run '564748'.
2020-09-28T14:45:45.3917393Z TestResults To Publish 21, Test run id:564748
2020-09-28T14:45:45.3960633Z Test results publishing 21, remaining: 0. Test run id: 564748
2020-09-28T14:45:45.3977089Z Publishing test results to test run '564754'.
2020-09-28T14:45:45.3978225Z TestResults To Publish 17, Test run id:564754
解决方案
看来您正在运行dotnet publish
命令。检查您的管道是否有类似的语法:
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet publish'
inputs:
command: publish
publishWebProjects: false
projects: '**/*.csproj'
arguments: '-o testpath'
zipAfterPublish: false
modifyOutputPath: true
此外,请检查以下链接,看看它是否对您有帮助:
推荐阅读
- bigcommerce - 如何在模板中获取 base_url
- javascript - 从后端强制登录 401 后做出反应
- reactjs - 在我的 React 应用程序中实现并添加自定义 polyfill
- node.js - Express root get 路由覆盖其他路由
- python - 情节:TypeError:“复杂”类型的对象不是 JSON 可序列化的
- php - 树枝导航宏
- amazon-ec2 - 无法为 apache nifi 建立站点到站点通信
- java - 如何在 MySQL 数据库中重新分配唯一的整数 ID?
- javascript - 使用 `ng-repeat` 为元素赋予不同的颜色
- android - 无法解决:om.google.android.gms:play-services-location:15.0.1