No test found. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again

前端 未结 30 1752
广开言路
广开言路 2020-12-05 04:00

I am in the process of upgrading our existing solution to .Net 4.6.1 and have been unable to get our unit tests to run during a server build. Locally they run as expected an

相关标签:
30条回答
  • 2020-12-05 04:06

    I got this error because my Unit test class was not public.

    Ex:

    class ClientTests

    Error in Output:

    ...\bin\Debug\Tests.dll] UTA001: TestClass attribute defined on non-public class ClientTests

    Correction:

    public class ClientTests

    0 讨论(0)
  • 2020-12-05 04:08

    I'm using MSTest. For me, it was version missmatch and missing another dependent package-

    1) My package folder contains only MSTest.TestFramework.1.2.1 package. In my project file(.csproj) the reference in Target Name was MSTest.TestAdapter.1.2.0 package which was not present in package folder. My packages.config has also reference of MSTest.TestFramework.1.2.0 .

    2) So I installed MSTest.TestAdapter.1.2.0 from nuget package manager and align MSTest.TestFramework version to 1.2.0 in project and package file. Finally I add Microsoft.VisualStudio.TestPlatform.TestFramework and Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions in the reference.

    Then everything was OK. Hope this help someone.

    0 讨论(0)
  • 2020-12-05 04:08

    I'll throw my solution onto the heap. In my case, I am adding a couple of projects to an existing solution along with Test projects for them. We're using MSTest. There was a previous UnitTest.testsettings file enabled on the solution that was causing compatibility issues.

    Clicking on the settings file removed the check and the test run was successful for my tests.

    0 讨论(0)
  • 2020-12-05 04:08

    This error can happen for async tests if you have the wrong return type. The return type should be Task, and not void.

    0 讨论(0)
  • 2020-12-05 04:09

    After add the TestAdapterPath in the commander, it's worked for me:

    vstest.console.exe Xom.Gci.Lvf.FileParserInvoker.UnitTests.dll /TestAdapterPath:"C:\****\****\{SolutionFolder}"
    
    0 讨论(0)
  • 2020-12-05 04:10

    In my case the tests were discovered but running resulted in "Test not Available..." and the (in)famous: "Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again."

    the error was independent of Visual Studio (tested from dotnet CLI tools and nearly naked UNit test) and it was only when targeting .NET 4.7.1. dotnetcore app works fine.

    also running tests with the Nuint3 CLI nunit3-console.exe Tests.csproj shows the error:

    "Either assembly contains no tests or proper test driver has not been found."

    the error was because the test-adapter could not be found on a (mapped) network drive or share and was solved by copy it locally and rerun.

    0 讨论(0)
提交回复
热议问题