No test assemblies found matching the pattern: **\*Test*.dll,!**\*TestAdapter.dll,!**\obj\**

Andy Miller picture Andy Miller · Sep 19, 2018 · Viewed 9.5k times · Source

I am trying to implement a Gated Check-In process in Azure DevOps (VSTS) based on the success of the unit tests. However, I am consistently getting this warning/error that assemblies are not found.

##[warning]No test assemblies found matching the pattern: **\*Test*.dll,!**\*TestAdapter.dll,!**\obj\**.
##[debug]Processed: ##vso[task.issue type=warning;]No test assemblies found matching the pattern: **\*Test*.dll,!**\*TestAdapter.dll,!**\obj\**.
======================================================

All my unit tests run successfully in Visual Studio 2017 in Test Explorer locally.

The Azure DevOps documentation seems straightforward but it does not work when I follow it.

I am using a Hosted VS2017 Agent. The CI Build itself succeeds upon check in to TFS source control.

Log

screen 1
screen 2 screen 3 screen 4 screen 5 [screen 6]

Answer

JeroenW picture JeroenW · Oct 4, 2018

The "old" .NET had the files located in the Release folder (which is described by the BuildConfiguration variable).

.NET Core builds contain an extra folder:

Folder structure

YourNamespaceHere.UnitTests > bin > Release > netcoreapp2.1 > dll's

When you add an extra wildcard, the build will find the unittest dll's.

**\$(BuildConfiguration)\*\*unittests.dll

I have renamed the *Tests* part to *unittests.dll as my project also contains integrationtests.

enter image description here