Skip to content

[17.6.0] No suitable test runtime provider was found for any source in this run. #4516

@nohwnd

Description

@nohwnd

Description

On AzureDevOps images windows-latest and windows-2022 you can run into No suitable test runtime provider was found for any source in this run. error.

This error is caused by additional dlls that were ignored in 17.5.0, being incorrectly passed on in 17.6.0.

To replicate this issue you need to be on 17.6.0 version of TestPlatform, and provide more dlls than what you are testing, for example by using the default assembly filter in AzureDevOps:

      **\*test*.dll
      !**\*TestAdapter.dll
      !**\obj\**

This filter will match .NET Standard and .NET Portable dlls, that are coming from your test adapter, and incorrectly pass them to be executed. In 17.5.0 those dlls would be silently ignored, but in 17.6.0 they fail to resolve the runtime provider and fail the run.

Workaround 1

Reduce your filter to only match the test dlls, and nothing more, for example if your test dlls use the following naming convention:

MyProduct.UnitTests.dll
MyProduct.IntegrationTests.dll

MyOtherProduct.Unit.Test.dll

You can use:

**\bin\**\*Tests.dll
**\bin\**\*Test.dll

Workaround 2

Use TestPlatform Installer task to install VSTest 17.5.0 (or 17.6.2), and instruct your vstest task to use it:

# Install VSTest 17.5.0
- task: VisualStudioTestPlatformInstaller@1
  inputs:
    packageFeedSelector: 'nugetOrg'
    versionSelector: 'specificVersion'
    testPlatformVersion: '17.5.0'

- task: VSTest@2
  inputs:
    testSelector: 'testAssemblies'
    testAssemblyVer2: |
      **\*test*.dll
      !**\*TestAdapter.dll
      !**\obj\**
    searchFolder: '$(System.DefaultWorkingDirectory)'
    # ------------  Use the version installed by installer -----------
    vsTestVersion: 'toolsInstaller'

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/visual-studio-test-platform-installer-v1?view=azure-pipelines

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions