gpt4 book ai didi

testing - 由于 testhost.dll,Azure-DevOps 管道失败

转载 作者:行者123 更新时间:2023-12-04 13:35:53 25 4
gpt4 key购买 nike

我的 azure devops 测试管道遇到了一些麻烦。
我正在使用 xunit 测试,每个测试项目都正确运行,我可以查看测试结果,但由于以下错误,管道无论如何都失败了

##[error]Testhost process exited with error: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
##[error]. Please check the diagnostic logs for more information.

喜欢建议 here , 我为 testhost.dll 添加了一个额外的过滤器所以我的 yaml-snippet 看起来像这样:
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test.dll
!**\*TestAdapter.dll
!**\obj\**
!**\testhost.dll
!*testhost.dll
searchFolder: '$(System.DefaultWorkingDirectory)'
diagnosticsEnabled: true
codeCoverageEnabled: true

但是,错误仍然发生并且我的构建被标记为失败。
我怎样才能解决这个问题?

最佳答案

GitHub issue应该希望有所帮助。

尝试的事情:

  • 删除从一个测试程序集到另一个测试集的引用
  • 将 Microsoft.NET.Test.SDK 更新到 16.6.1
  • 添加 application.runtimeconfig.json 文件

  • 希望这可以帮助!

    关于testing - 由于 testhost.dll,Azure-DevOps 管道失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62090915/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com