No test found. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again
Solution 1
This is a known issue for .Net 4.6 now.
Unable to run .Net 4.6.x unit tests as part of a XAML TFS Build with TFS 2015 UPdate1 Source:https://connect.microsoft.com/VisualStudio/feedback/details/2245723
Here is a similar question for you reference: Unable to run .Net 4.6 Unit tests of TFS 2015 XAML build server
Solution 2
You can try to change your default processor architecture in your Test Setting from X86 to X64. In my case this was the problem.
This happens if the platform target of your project under test is set to x64
.
Solution 3
My build was not finding the tests either. My setup and solution for finding the tests are as follows.
I use VSTS (Visual Studio Team Services) and have a build that is configured to refresh the NUGET packages on every build. I am using NUnit and found that running the following NUGET command (from the package manager console in Visual Studio) to add NUnitTestAdapter library to my test project and the checking in the packages.config made the tests run in my VSTS build.
Install-Package NUnitTestAdapter
As Maurice mentions in the Comment to this post for NUnit3 use the following NUGET package (Look for other utils on the link. i.e: dotnet CLI and Paket CLI)
Install-Package NUnit3TestAdapter
Hope this helps.
Solution 4
In my case, I had to:
-
Convert test project to netcore 2.0 (was netstandard 2.0)
-
Add nuget package
xunit.runner.visualstudio
Reference: http://www.neekgreen.com/2017/11/20/xunit-no-test-is-available/
Solution 5
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.
Tore Østergaard
Working actively with C#, C++ and Team Foundation server. By night I do a little hoppy development in php, MySQL, javascript and html.
Updated on July 08, 2022Comments
-
Tore Østergaard almost 2 years
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 and flipping the framework version back to .Net 4.5.1 makes them run again on the server.
I am getting the following error:
No test found. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
I have reproduced the problem in a simpler setup:
- Solution with a single C# Unit Test project with two tests (one failing, one passing).
- XAML build definition using the Default Template (TfvcTemplate.12.xaml)
- TFS 2015 Update 1 XAML build server with Visual Studio Enterprise 2015 Update 1 installed (have six similar servers and all produce the same result)
-
Tore Østergaard over 8 yearsHi Patrick. Both of the links you supply is cases opened by me, so I wouldn't trust them as reference ;-).
-
Maurice Klimek over 6 yearsI'm also currently using VSTS. As adviced I added NUnit3TestAdapter (since I'm using NUnit 3.8.1) and this solution solved my problem. Thank you :-)
-
Tore Østergaard over 6 yearsMy problem was with (on-prem) TFS 2015 Update 1 and it was fixed with Update 2. I am not sure if the same issue exist/existed with VSTS.
-
Amna about 6 yearssame issue was with me. I am using xunit with .net core
-
Jeremy Thompson almost 6 yearsI bumped into this with .Net 4.6.1 VS2017. I ended up rolling back to 1.2.0 - definitely make sure you dont have two different versions in your packages folder or in source control.
-
James Joyce almost 6 yearsMine appeared to find the tests, but yes, missing "MSTest.TestAdapter" was the real issue. No nice errors or warning (VS2017 15.8). All looked good except no tests were found, despite appearing in the test explorer..... So when I did "install-package MSTest.TestAdapter" suddenly my tests ran as expected. Thanks MS - 3 hours wasted...........
-
Thorkil Værge almost 6 yearsThis also worked for me in Visual Studio 2017 with xunit and .NET Core 2.1.
-
Michael Levy over 5 yearsYes! And don't forget to restart Visual Studio. That was required for me.
-
Bimal Das over 5 yearsInstall-Package NUnit3TestAdapter solved my issue :)
-
Juan about 5 yearsin my case was a .net 4.6.1 project so the only thing missing was the xunit runner. Installed it and worked.
-
Sean Kendle about 5 years"At the top of the menu" what does that mean?
-
J Wood about 5 years@SaiyajinGohan. After you complete step 2, the "Extensions and Updates" window appears. At the top of this window, I saw the NUnit adapter was disabled. Hope this clarifies....
-
Sean Kendle about 5 yearsThanks for that, I still couldn't get this working with the project I was working on. Luckily it was a test project and the next one worked. Still a mystery as to why.
-
dixiashi almost 5 yearsFirst things, you should make sure that the test case can be run in the VS IDE.
-
datchung over 4 yearsThis solved it for me. In my case, both the project being tested and the test project were set to x86. Tests were disoverable but failed to run. After I changed it to Any CPU, tests ran.
-
furman87 over 4 yearsInstalling the MSTest.TestAdapter 1.4.0 did it for me in VS 2019. I only wasted 30 minutes thanks to you.
-
David Yates over 4 yearsThis did indeed bite me. I think the clue that this is happening is that it FINDS the unit test DLL, but it does NOT find any tests in it. I also found that putting this inline after your copy statements will let you inspect to see what WAS copied (here /app/tests is your target directory on the Docker image): RUN file="$(ls -al /app/tests)" && echo $file (see this post for more info on echo )
-
Allen about 4 yearsI just had the same problem and this resolved it. I am also quite suspicious that this may have had a bad nego-synergistic effect on my main project references, which suddenly stopped loading a particular DLL, but have not conclusively determined this nasty side effect.
-
Premil almost 4 yearsSame as Juan. Only the runner package was missing. Running this in the package manager for the test project solved it: install-package xunit.runner.visualstudio
-
rajibdotnet over 3 yearsThis actually worked for me after banging my head in so many directions and suggestions.
-
JohannSig about 3 yearsConfirmed. Accidentally removed the runner.visualstudio nuget package (keeping the xunit one). Re-introducing it fixed this problem. Thanks!
-
Kevin over 2 yearsUpdating MSTest.TestAdapter (2.1.2->2.2.7) and MSTest.TestFramework (2.1.2->2.2.7) fixed it for me. Thanks!
-
Admin over 2 yearsYour answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.