Jason Coyne
Jason Coyne

Reputation: 6636

Azure Devops CI Test Adapter fails. Strong Name Validation Failed

When doing my CI build, the pipeline fails with the error :

An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

The relevant portion of my YAML is

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

Im using MSTest.TestAdapter v2.2.5 which is "Latest Stable" from nuget. Build and tests run fine from Visual Studio.

Upvotes: 0

Views: 287

Answers (1)

Kevin Lu-MSFT
Kevin Lu-MSFT

Reputation: 35194

executor://mstestadapter/v2': Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name validation failed.

Based on the error message, you could check if you are using the .net core project.

If yes, you could use the .net core template to replace the VSbuild template and check if it could work.

For example:

- task: DotNetCoreCLI@2
  displayName: Restore
  inputs:
    command: restore
    projects: '**/*.csproj'

- task: DotNetCoreCLI@2
  displayName: Build
  inputs:
    projects: '**/*.csproj'
    arguments: 'xxx'

- task: DotNetCoreCLI@2
  displayName: Test
  inputs:
    command: test
    projects: '**/*[Tt]ests/*.csproj'
    arguments: '--configuration $(BuildConfiguration)'

Upvotes: 2

Related Questions