microsoft / vstest

Visual Studio Test Platform is the runner and engine that powers test explorer and vstest.console.
MIT License
884 stars 319 forks source link

The experience is bad using `dotnet test` with net35 because all tests are silently skipped #2763

Closed jnm2 closed 3 years ago

jnm2 commented 3 years ago

This is very similar to https://github.com/microsoft/vstest/issues/1850, but for net35 instead of net40.

The SDK is failing to set <IsTestProject>true</IsTestProject>. This is something that should probably be set in a buildMultitargeting .props file so that it gets set for the project no matter what the target framework is.

The fact that VSTest only supports running tests on net40 and up does not mean that it's okay to silently skip all tests. IsTestProject should still be defined, and VSTest should still print out the warning that "For projects targeting .Net Framework 3.5, test will run in CLR 4.0 compatibility mode," and it should still go ahead and run the tests.

This resulted in tests not running in CI for a while, unnoticed.

nohwnd commented 3 years ago

@jnm2 At the moment we are supporting net452 and newer, and we are looking for was to lift that further because supporting older frameworks is a big maintenance burden. There are no plans to add support for net35. Sorry.