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

用户名

我的天蓝色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.

就像这里建议的一样,我为添加了一个额外的过滤器,testhost.dll因此我的yaml代码段如下所示:

- 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问题能有所帮助。

尝试的事情:

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

希望这可以帮助!

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章