Skip to content

[MSTest][Discovery] MSTestPlayground.exe Failed to discover tests from assembly (After upgrade from 2.1.2 to 2.2.8) #1019

@nir-boger

Description

@nir-boger

Description

Getting the following error while trying to run MSTests that are being hosted in a console application assembly

Microsoft (R) Test Execution Command Line Tool Version 16.11.0 Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait... A total of 1 test files matched the specified pattern. [MSTest][Discovery][MSTestPlayground.exe] Failed to discover tests from assembly MSTestPlayground.exe. Reason:It is illegal to reflect on the custom attributes of a Type loaded via ReflectionOnlyGetType (see Assembly.ReflectionOnly) -- use CustomAttributeData instead. No test is available in C:\Users\niboger\source\repos\MSTestPlayground\bin\Debug\MSTestPlayground.exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

Additionally, path to test adapters can be specified using /TestAdapterPath command. Example /TestAdapterPath:.

Steps to reproduce

I've created this repo for reproduction: https://github.com/nir-boger/ms-test-v2.2.8-bug

Expected behavior

1 Test being executed and passed

Actual behavior

No tests were executed

Environment

  • Win11
  • 16.11.0
  • 2.2.8

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions