I'm having some troubles with my azure devops testing-pipeline. I'm using xunit tests and every test-project runs correctly and I can view the test results, but the pipeline fails anyway because of the following error
##[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.
Like suggested here, I added an additional filter for testhost.dll
so my yaml-snippet looks like this:
- 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
However, the error still occurs and my Build is marked as failed. How can I fix this?
testhost.dll
fortestSelector
:testPlan
instead oftestSelector
:testAssemblies
– Autocephalous