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:
My run settings file:
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:
My run settings file:
Refer to these additional settings of Visual Studio Test task:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform
/framework:".NETCoreApp,Version=v2.0"
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\**
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.
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
.