我的天蓝色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代码段如下所示:
- 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应该有所帮助。
尝试的事情:
希望这会有所帮助!