Azure DevOps VSTest@2 isn't finding any test in test dll

Viewed 41

The VSTest@2 does not find any test in a test dll but runs the other tests in other dlls just fine. When I ran the vstest.console.exe command locally on the problem dll, all tests were found and passing.

Fails with the message:

NUnit failed to load C:\a\1\s\test\bin\Framework\Test\Extensions.MSGraph.dll
  • The dll is definitely present because I can see it in the list that the task prints out before it starts the test.
  • I have both NUnit and NUnit3TestAdapter NuGet packages as project ref, as suggested by other posts.
  • I have also added the "[TestFixture]" decorator to the class.

Is there any other config, settings, or project related settings that would cause the NUnit failure?

1 Answers

It is possible that one of the transitive dependencies are missing (e.g. your project depends on Extensions.MSGraph.dll, and this library depends on some X.dll which is not present).

You can see the list of all library dependencies in Visual Studio like this: How can I track down the source of a transitive dependency?

There are also other tools that can list the library dependencies.

Related