5

My VSTS - "Visual Studio Test" task can't find any tests of the .NET Core assembly. But in VS 2017 and in the console, it works well.

VSTS Task's logs:

enter image description here

enter image description here

enter image description here

My run settings file:

enter image description here

Daniel
  • 2,355
  • 9
  • 23
  • 30
Fanny
  • 111
  • 2
  • 7

4 Answers4

8

Refer to these additional settings of Visual Studio Test task:

  1. Path to vstest.console.exe: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform
  2. Other console options: /framework:".NETCoreApp,Version=v2.0"
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
1

I had a similar issue where the cause was I had copied a semi-colon separated search pattern in the "Test files" field from my v1 Visual Studio Test task definition to my v2 definition

Apparently v2 does not support semi-colon separation so i changed to new-line separation and it worked.

I.e. changed build/Tests/*Test.dll;-:**\obj\** to

build/Tests/*Test.dll -:**\obj\**

Lars Pellarin
  • 606
  • 6
  • 10
0

Remove <TargetFrameworkVersion>Framework45</TargetFrameVersion> from runsettings.

As mentioned in warning message(Following DLL(s) do not match framework/platform), vstest.console ignoring .NET Core test-assemblies because the TargetFrameworkVersion value(Framework45) in runsettings.

You can remove TargetFrameworkVersion from runsettings if you are using VS >= 15.5. From 15.5 vstest.console has capability to detect framework and platform by reading metadata from test-assembly.

Satya Madala
  • 325
  • 3
  • 8
  • Thanks to your reply, but I tried to remove it and it doesn't work. The same messages... – Fanny May 21 '18 at 02:30
0

Commonly this is caused by a lack of a test adapter for the framework you're using. For example for nunit you need to use nunitTestAdapter.

Eloise
  • 109
  • 9