147

I have a simple solution in visual studio 2013 that is composed by one web project, one library project and one unit test project. When I open the solution and try to run the unit tests they are not discover by visual studio. To run the tests I try to go to the menu and choose Test -> Run -> Run all tests or by opening the test explorer window. By those to methods visual studio doesn’t discover any tests in the solution.

Creating first a simple unit tests project and try to run the test, visual studio know discover the test and I can run it. Then, if I open my previous solution visual studio now discovers all the tests. I try to save my solution but closing it and reopening, without creating a unit test project first, the visual studio doesn’t find the tests again. This is a very strange behave that I don’t know why this is happening.

I used to working alone in this project that was using the source control git integrated with the visual studio team foundation. The problem of visual studio not discover the unit tests start when a new element came to the project and when I need to recreate the solution through the source control online. Before this, all tests always been discovered by visual studio.

For creation the unit tests I use the dll Microsoft.VisualStudio.QualityTools.UnitTestFramework. My version of visual studio is: Microsoft Visual Studio Express 2013 for Web Version 12.0.30723.00 Update 3. My version of .net framework is 4.5.50938.

All of my tests are like this:

[TestClass] 
public class Service1Test 
{ 
    [TestMethod] 
    public void Test1() 
    {
        Assert.IsTrue(True); 
    } 
}
Guilherme Fidelis
  • 1,022
  • 11
  • 20
miguelbgouveia
  • 2,963
  • 6
  • 29
  • 48
  • 2
    Are these Async based Unit tests? – Jamie Keeling Aug 14 '14 at 09:20
  • Not sure what the issue was, but running as administrator fixed the issue for me. – Sriram Sakthivel Aug 14 '14 at 09:29
  • All sync based unit tests – miguelbgouveia Aug 14 '14 at 10:31
  • 2
    Have you tried an external test-runner (like ReSharpers or NCrunch)? Maybe your install is bugged (so reinstall VS) – Random Dev Aug 14 '14 at 10:44
  • I already try to reinstall visual studio and make all the updates but the problem maintains. I will try an external tool but I think it will work fine. The problem seems to be in visual studio. – miguelbgouveia Aug 14 '14 at 10:48
  • Did you clean your solution and rebuild everything? Perhaps rebuild all projects inside it separately? Do you get any output in the Tests and Build output pane? – Jeroen Vannevel Aug 14 '14 at 11:34
  • I try to install the external tool NCrunch. I think because I’m using VSExpress version I have to install this tool manually. After I run the command: VWDExpress.exe /setup /nosetupvstemplates to install the tool miraculously the tests start appearing in VS. Closing a reopening the solution, the tests disappear again. Funny that after all the installation of the tool doesn’t result. – miguelbgouveia Aug 14 '14 at 11:35
  • @JeroenVannevel, I already try to clean my solution and rebuild everything without results. Rebuild all projects also doesn’t work. When building the projects I get the following message: ------ Discover test started ------ The system cannot find the file specified ========== Discover test finished: 0 found (0:00:00,2675781) ========== – miguelbgouveia Aug 14 '14 at 13:46
  • 1
    None of these fixed the issue for me :( What a disaster. I've given up NUnit and am relying on UnitTestFramework - bizarrely the opposite problem from the OP – Adam Sep 21 '16 at 08:30
  • The same for me @Adam. I use known Xunit. – miguelbgouveia Sep 21 '16 at 14:08
  • for me it was not working because my project was located on a network drive, moving it to a local folder fixed it – Ruben Feb 06 '17 at 09:46

38 Answers38

211

Some things I've noticed I have to do from time to time to get tests to show up properly.

  1. If your solution is in a protected drive that you need administrator access to read/write, sometimes only a portion of the tests come up. Definitely run VS as administrator in that case.

  2. If your solution is 64 bit, make sure that Test > Test Settings > Default Processor Architecture is set to x64. Sometimes it gets set to x86. Set it to x64, then rebuild.

  3. Sometimes just restarting Visual Studio does the trick because the test explorer will start up again.

  4. Don't forget to actually build the test project/solution. (If you want it to get built with the rest of the projects, right-click on your solution > Properties > Configuration Properties > Configuration > check the "Build" box for your test project)

  5. Ensure the tests are in a public section of your test class

AndyG
  • 39,700
  • 8
  • 109
  • 143
  • 34
    I realize this answer is a little late, but my Google search brought me here, and nothing mentioned solved my problem. Eventually I figured out it was #2 in my list, so I wanted to leave that knowledge, plus the other tricks I've picked up over time. – AndyG Mar 18 '15 at 18:50
  • 7
    A combination of #2 and #3 did it for me. Visual Studio complained about a number of (non-test) projects in my solution being excluded from the test discovery step because they were built for x86, but that was fine. – Nate Barbettini Jul 16 '15 at 14:52
  • 4
    I found that my settings were all correct and restarting did not work. What did fix the problem for me was simply building the solution. I know this may seem dumb but it is not obvious that is necessary; I have not seen any of the official docs mention this step. – user1807768 Jul 20 '15 at 18:19
  • 6
    I had the same problem in VS2015. #2 fixed the problem for me. – mcolegro Nov 06 '15 at 17:09
  • 2
    I have no idea why people pay so much money for a product that fails so often. I had to upgrade my project to 2015 and do #3 2 times before it discovered my test. – Matthew Hoggan Jan 06 '16 at 07:50
  • 2
    I hate the test explorer with a passion – Chris Hawkes Jan 18 '16 at 15:53
  • #4 for me, had forgotten that I had set the test project to only build in debug. – Ryan Buddicom Mar 19 '16 at 03:55
  • 1
    5. Make sure your assembly isn't also in the GAC. The test explorer will find the one in the GAC first and not see your new tests in your solution. – metalhead Apr 21 '16 at 17:35
  • I had to switch my solution configuration to Debug. It was on one of my other transform configs. – duyn9uyen Aug 22 '16 at 21:39
  • @duyn9uyen: That's interesting, is there are preprocessor macro that prevents the tests from compiling unless it's for DEBUG? – AndyG Aug 22 '16 at 21:51
  • Number 2 + 3 did the trick for me. I was experiencing this issue in VS 2015, where my solution contains Service Fabric projects (x64), but my unit test class libraries were set to "Any CPU". So as soon as I referenced an x64 project from the unit test project, the tests would simply fail to be discovered. So in addition to #2 and #3, I had to change the target platform of the unit test project to x64. – Sipke Schoorstra Sep 11 '16 at 08:08
  • Same problem with VS2015 Community edtion. I actually had this issue after the Windows 10 Anniversary update, I needed to run as administrator (previously this wasn't necessary). So #1 for me. Thanks for the thorough answer @AndyG – Vort3x Sep 30 '16 at 07:43
  • #3 was my problem. Thanks. – Loren Pechtel Nov 05 '16 at 21:29
  • To elaborate on step #1: I had NUnit installed but it was for unknown reasons disabled. Uninstalling didn't seem possible and then it hit me: I've been running VS with Administrator privileges whilst NUnit was installed without it. – Tom Dec 01 '16 at 13:21
  • @metalhead - I did not need to check the GAC, but if you're right about that please edit the answer to add it. And man, i'll add, that's insane. How this (relatively expensive) product can fail silently like this, requiring (for me) some arbitrary combination of #2 and a vs-restart (#3) ... – some bits flipped Dec 26 '16 at 22:09
  • 1
    Don't forget to make the test method public. Took me a good part of an hour to figure that out! – jao Feb 20 '17 at 08:42
  • Adding the following dependency fixed it for me: `"Microsoft.DotNet.InternalAbstractions": "1.0.1-beta-003206"` – whiteshooz Apr 05 '17 at 18:00
82

If you using NUnit, make sure to download NUnit Adapter first.

Go to Tools → Extensions and Updates… → Online → search for "NUnit Test Adapter".

p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
Farukh
  • 2,173
  • 2
  • 23
  • 38
61

Make sure your test class is public so it can be found. And if you're referencing another class, make sure of the same.

Also, sometimes if you have no Asserts or you're not decorating the test with a [TestMethod], a test might not be recognized.

2 more things: 1) Async unit tests act funny at best, and none at all at worst. Have a look at this article by Stephen Cleary and keep from there if it interests you.

2) If you use NUnit and you run into the same issues, keep in mind it's [TestCase] for Nunit, instead of [TestMethod]

Having said the above, here's an article I've posted on the code project, with both MSTest & NUnit, in case you want to give it a spin and make sure you're not missing anything.

Noctis
  • 11,507
  • 3
  • 43
  • 82
  • 1
    All of my tests are like this: [TestClass] public class ServicesUtilsTest { [TestMethod] public void Test1() { Assert.IsTrue(True); } } – miguelbgouveia Aug 14 '14 at 09:40
  • this is not very clear . Put it in a code block in your question, so it can be understood :) – Noctis Aug 14 '14 at 09:45
  • All my tests is for sync code, and I think my problem is not in the unit tests code but more in visual studio sometimes not discovering the tests. – miguelbgouveia Aug 14 '14 at 10:30
  • Try using this instead: `using Microsoft.VisualStudio.TestTools.UnitTesting;` – Noctis Aug 14 '14 at 10:33
  • 1
    I am already using Microsoft.VisualStudio.TestTools.UnitTesting. This namespace are defined in the dll Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll – miguelbgouveia Aug 14 '14 at 10:44
  • Asynchronous unit tests are supported in VS 2013, which is what the OP is using. – Jeroen Vannevel Aug 14 '14 at 11:32
  • @JeroenVannevel Yep, but they might not act as he expects, unless he's aware of what's happening. – Noctis Aug 14 '14 at 11:42
  • Hmmm I had private fields in my test class, and when I switched em to public after reading this my test was rediscovered. Thanks @Noctis – Jacob McKay Jul 15 '16 at 20:18
  • In my case, class was not public.. Thank you – Siva Sankar Gorantla Jul 18 '16 at 13:13
  • This triggered the solution for me; the test function was marked `static`. Removing the modifier and rebuilding the project immediately made it appear in the Test Explorer. – Aaron Jan 04 '17 at 12:45
  • @Aaron hmm ... interesting ...wonder why a static method will not be picked up ... you using mstest or nunit? and which version btw ? – Noctis Jan 04 '17 at 23:48
  • @Noctis MSTest, `"MSTest.TestAdapter" version="1.1.8-rc"` and `"MSTest.TestFramework" version="1.0.8-rc"`. – Aaron Jan 04 '17 at 23:57
28

I had the same issue but none of the other solutions worked. Turns out that I was using the NUnit 3 framework with the 2 adapter.

If you're using NUnit 3, go to Extensions and Updates and install the NUnit3 Test Adapter.

Frank
  • 693
  • 8
  • 12
  • It does say this in the description of the Nuget package. But if you're like me and don't read, I'm hoping that this will help: "This package includes the NUnit 3.0 framework assembly, which is referenced by your tests. You will need to install version 3.0 of the nunit-console program or a third-party runner that supports NUnit 3.0 in order to execute tests. Runners intended for use with NUnit 2.x will not run 3.0 tests correctly." – Frank Jul 22 '15 at 22:31
  • In my case I knew it had something to do with the NUnit3 update, but one set of my test passed and the others weren't seen. Upon closer inspection there were a lot of exceptions in the output, even though the tests all passed. – Rich Shealer Nov 17 '15 at 14:00
  • This was the case for me too. I had run nuget "update-package" without realizing it updated from NUnit 2.x to 3.x. – Jens Dec 21 '15 at 08:15
  • Currently the NUnit 3.0 Test Adapter can't be found via NuGet (see the [NUnit 3.0 Wiki](https://github.com/nunit/docs/wiki/Adapter-Installation)). It can stil be installed as an extension though. – vauhochzett Mar 08 '16 at 16:17
  • I had a NUnit 2 Test Adapter installed with NUnit 3 framework as nuget package. Reading your answer made me realize this mistake. After installing Nunit 3 Test Adapter, it works fine for me. Thanks for the hint. – tyrion May 13 '16 at 07:22
  • 1
    Thanks a lot Frank. It solved my issue. Now I am able to see the unit test results in the console window :) – santosh kumar patro Jun 04 '16 at 19:04
12

I'm having this issue from time to time. What works for me is to shutdown Visual Studio and go to folder:

%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache

and delete it content.

Once you open Visual Studio and load your project again Test Explorer should contain back your tests

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Mariusz Gorzoch
  • 479
  • 6
  • 8
  • For me that doesn't work. I am using Visual Studio 2013 Express with update 5 install recently. Still no unit tests appearing. – miguelbgouveia Jul 24 '15 at 13:31
  • This was also what worker for me. Even worked without restarting visual studio. Hours down the drain finally had an end. – Stephan Møller Jan 18 '17 at 11:05
  • This directory does no longer exist in VS2017. – Noel Widmer Oct 24 '17 at 09:15
  • Thanks it works for me for any of those this folder can have diffrent version depending on the installation of visual studio like for me it is `%LocalAppData%\Microsoft\VisualStudio\16.0_03b7a93c\ComponentModelCache` – Ravi Kumar Mistry Feb 10 '20 at 07:03
12

XUnit users may notice Test Explorer window no longer lists any tests. To make tests discoverable again try this important tip, highlighted below.

If you're having problems discovering or running tests, you may be a victim of a corrupted runner cache inside Visual Studio. To clear this cache, shut down all instances of Visual Studio, then delete the folder %TEMP%\VisualStudioTestExplorerExtensions. Also make sure your project is only linked against a single version of the Visual Studio runner NuGet package (xunit.runner.visualstudio).

Type in TEMP to find target folder

SushiGuy
  • 1,573
  • 17
  • 20
  • This didn't work for me. Test explorer just does not find my test and as far as I can tell I'm not doing it wrong and I've tried some of the solutions here without success. – Skystrider Oct 03 '17 at 23:02
  • Using MsTestV2 - this was the only thing that fixed the problem – Nathan Nov 08 '18 at 19:54
5

For future googlers I had a rare scenario that caused this.

On my base test class I had a property named TestContext. This interfered with MSTest's reserved TestContext property causing all my tests to be hidden from VS/Resharper except one (which did not inherit from the base).

AdamB
  • 61
  • 1
  • 2
4

for me it was changing 'solution configurations' to Debug (instead of Release).

zook2005
  • 195
  • 2
  • 7
4

My problem was because my unit test method wasn't void, and it was receiving parameters.

alansiqueira27
  • 8,129
  • 15
  • 67
  • 111
  • Of all the things.... This was my problem and the params bit makes sense. After all, what would the test system know to pass in? The solution there is to make a test method where you manually call the method you want to test. If you're testing a WebAPI project and have a Get with params, you still have to have the matching Get call but it won't show up in explorer. – user4593252 Mar 22 '16 at 19:26
4

I have found that unit test methods marked as async void aren't discovered by the VS Test Explorer. This seems to be because VS would not have any way to wait for a test to finish and decide if it succeeded or not. If you absolutely need to have a test method to run asynchronously then get it to return a Task instead like async Task. I found that this fixed the issue for me.

cookiemonster
  • 131
  • 1
  • 5
  • 1
    This does not answer the question above, but this is exactly the problem I was trying to solve. So you got accident +1 :) Thank you so much! – C-F Jul 29 '16 at 09:06
3

Try building all projects as MSIL (Any CPU) instead of x86/x64. Worked for me strangely

Alfons
  • 511
  • 4
  • 17
  • I just had to build the Test project using Any CPU, the other projects remained x64 – Eduardo Brites Dec 20 '15 at 12:02
  • 1
    Technically, C#/VB.NET always compile to MSIL. The project setting "x86", "x64" or "Any CPU" (and, in newer versions, "Prefer 32-bit") is just flags at the top of the EXE/DLL. Point still stands, though; NUnit won't list tests it can't load into the execution engine, on account of them being marked as requiring a particular architecture to run. – Jonathan Gilbert May 11 '16 at 20:11
3

While AndyG's solution works, a more lasting solution could be to set the PreferredToolArchitecture environment variable to "x64", either by:

How to make Visual Studio use the native amd64 toolchain

or by:

  • Control Panel | System and Security | System | Advanced System Settings|Environment Variables
  • PreferredToolArchitecture = x64
  • DefaultToolArchitecture = Native64Bit
  • PROCESSOR_ARCHITECTURE = x64
  • ProcessorArchitecture = x64
Community
  • 1
  • 1
empty
  • 5,194
  • 3
  • 32
  • 58
2

I was facing the same problem and I've remembered, again (this situation happened before), that selecting "Mixed Platform" on the solutions platform menu works, as well as the other answers.

Jeferson
  • 21
  • 3
  • But where is the solutions platform menu? Is that in Visual Studio? I'm using Visual Studio Express 2013 for Web and I can't find that menu. – miguelbgouveia Jul 24 '15 at 13:23
2

I'd managed to add mine as

public static void TestMethod1(){}

started working once I removed static....

2

Go to Nuget package manager and download Nunit Adapter as follow. enter image description here

Debendra Dash
  • 5,334
  • 46
  • 38
1

go to the project menu > Configuration Manager check your test project platform matches the rest of the project and is check to build then rebuild.

  • 1
    I don't have any Configuration Manager option in my project menu. I can only find the project properties option. I very the platform of the unit tests project and it is the same of the others projects. So, for me this solution doesn't work. – miguelbgouveia Aug 24 '15 at 13:42
  • Define "matches the rest of the project" – amalgamate Nov 18 '15 at 20:59
1

Just ran into this as well as I didn't see a similar case that was similar to mine.

In the .csproj file of my test project, NUnit reference privacy was set to False:

<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
  <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
  <Private>False</Private>
</Reference>

After I set <Private> to True it worked.

Kevin Giszewski
  • 135
  • 1
  • 8
1

You just need to install this package only:

NUnit TestAdapter NUnit TestAdapter

Community
  • 1
  • 1
Sandy_Vu
  • 51
  • 3
  • I known that using another unit test framework will resolve my problem. But if I wanted continuing use the Microsoft Unit Tests framework that is not a solution. – miguelbgouveia Jan 26 '16 at 09:34
1

To get tests to show in the Test Explorer Window I had to install NUnit3 Test Adapter 3.0 which was not available in Package Manager.

Downloaded from https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d

Mikal Madsen
  • 569
  • 1
  • 7
  • 18
1

I had the exact same problem.

It was due to incompatible version of NUnit I'd added to my project (3.2.0) and the Test Adapter I had installed (2.0.0).

To fix, use "Tools > Extensions and Updates" and search for NUnit3 Test Adapter, it discovered my tests after that.

Cheers

1

Let's just say for argument's sake that you need to use X64 architecture on your test project in order for the dependencies to build properly (as in my case). You may need to modify your Default Processor Architecture under the Test--Test Settings menu. Setting this to X64 allowed my test explorer to find my tests using Microsoft.VisualStudio.TestTools.UnitTesting.

1

Sorry for adding to the long list, but I had a completely a different problem. First, I would like to mention I discovered my issue when clicking 'Run All' in the Test Explorer and then watching the build output window in Visual Studio. You have to actively watch it, as afterwards the message disappears.

As for the issue, it looks like during the scanning of the tests, the DLL gets loaded and its test types are enumerated. This causes the references to be loaded and if any failure occurs during this process, the tests will not be shown in the explorer. I had two issues preventing the test DLL to be successfully loaded:

  • There was still a binding redirect left in the config file (redirecting to a version lower version NHiberate than what was referenced in the test project).
  • A conflicting assembly reference (2nd level references not being able to load). AsmSpy is btw a great tool to hunt for these.
Martijn Evens
  • 266
  • 3
  • 5
1

If you load a Visual Studio (VS 2015 Community in my case) solution from a network share or My Documents directory that is part of a share, you will get into this trouble. I solved it by moving the solution and its underlying projects to a local folder.

Ton Snoei
  • 2,637
  • 22
  • 23
1

After spending 2 days... none of the above worked for me. The only "solution" was: Go to project properties -> Build Tab. Then click Advanced button on the right bottom corner of the pane. Change "Debug Info:" to "full" and click OK.

Here are the screen shots: enter image description here

enter image description hereenter image description here

curiousBoy
  • 6,334
  • 5
  • 48
  • 56
0

I came across the same issue. And investigated and found that the dll's were not build, and put in the right folder. as soon as I changed my configuration they appeared. - the Projects build options, what folder should be used? - the build menu entry build configuration, they should be checked.

that fixed it for me.

kfn
  • 620
  • 1
  • 7
  • 26
  • For me, the dll's for the tests also weren't build because visual studio doesn't find any defined tests. I'm using Visual Studio Express and I don't have the Build menu entry. But in my configuration manager I have all build options checked. So, I think that is no the problem for my case. – miguelbgouveia Sep 04 '15 at 13:41
  • @miguelbgouveia, it's the other way around - VS builds DLLs, and then scans those for tests. So if you have no test project DLLs, you will definetely find no tests. –  Feb 22 '16 at 13:09
0

For the Visual Studio 2013.5, clearing the \TestResults directory in the solution helped. Visual Studio corrupted the mdf file in which it stores the discovered tests, thus preventing the discovery of unit tests.

MartijnK
  • 642
  • 5
  • 19
  • 1
    It's in the solution of your project. Right-click your project file in the Solution Explorer -> Open Folder in File Explorer. Go one directory up from there and delete the /TestResults directory. You may have to shut down Visual Studio to delete everything. It will rebuild the directory the next time the project is opened. – MartijnK Sep 23 '16 at 12:53
0

Be sure your all projects are runing with the same configuration. Under your project's Properties => Debug => Platform in drop down list choose the appropriate platform (for me it was "Any CPU") as determined at your other projects.

Roni
  • 369
  • 1
  • 7
  • 22
0
  • I know that the unit tests are not found if the solution is not built, so that is something to try (Build the solution), but that solution is like the help desk asking if your computer is plugged in...
  • After a clean rebuild did not fix the problem for me, running a full batch build did fix it.
amalgamate
  • 2,200
  • 5
  • 22
  • 44
0

Had the same issue; tests suddenly stopped being discovered.

Nunit Test Adapter had become disabled somehow. Clicking enable in the extension manager fixed it for me.

HeatherD
  • 1,521
  • 1
  • 10
  • 7
0

I had the same problem until I realized I made a cut/paste error and left off [Test Method] before the test.

forforf
  • 895
  • 7
  • 14
0

In my case the problem was because my class was marked as abstract.

Just remove the abstract keyword.

glautrou
  • 3,140
  • 2
  • 29
  • 34
0

Another solution:

Open a command prompt, type set, and verify if PROCESSOR_ARCHITECTURE is set correctly, change to x86 or AMD64 if needed.

source: https://connect.microsoft.com/VisualStudio/feedback/details/873170/vs2012-vstest-console-exe-error-incompatible-target-platform-settings-x86-with-system-architecture-arm-occurs-when-processor-architecture-is-not-set

Alfons
  • 511
  • 4
  • 17
0

I had the same problem with my tests on TFS 2015. The problem I had was my test did not show up anymore. the test adapter could not find any tests. I removed all references for Microsoft.VisualStudio.QualityTools.UnitTestFramework and now they show up again. I hope my answer help someone

Joerg
  • 131
  • 8
0

I had a similar issue to this with Visual Studio 2015. As soon as I made an async Task unit test Visual Studio would start having problems discovering it, finding the source for it, and it wouldn't allow me to debug it.

It turns out that there is a bug with PostSharp which causes this behaviour, and the test project I was using had PostSharp enabled.

The solution in my case was to disable PostSharp for the unit test project, by putting the following in the <PropertyGroup> element a the beginning of the csproj project file:

<SkipPostSharp>True</SkipPostSharp>

Adam Goodwin
  • 3,951
  • 5
  • 28
  • 33
0

In my case, I updated NUnit from 2.X to 3.X after what the driver stopped to go into [SetUp]. I tried to install NUnit 3 adapters from NuGet, but it did not help. Then I uninstalled my then current version on TestDriven (3.8) and installed 3.10 instead. It started to work (again).

Alex Konnen
  • 717
  • 6
  • 20
0

Make sure the project is marked as test project. You can do that by adding the below xml to the csproj project file.

 <Project>
...
 <ItemGroup>
    <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
  </ItemGroup>
...
</Project>
DonO
  • 1,030
  • 1
  • 13
  • 27
0

In my case, I had to update two NuGet Packages. - MSTest.TestAdapter - MSTest.TestFramework

Magic Mike
  • 25
  • 6
0

Had the same problem on a legacy project using VS2008. In the test output window, it kept printing that the unit test DLL was not a Nunit Test. I'm using the plugin NunitForVS by-the-way from https://archive.codeplex.com/?p=nunitforvs and yes I have followed the instructions and added the ProjectTypeGuids to the proj file.

Turned out that the NunitSettings.xml file in the folder \Users<user>\AppData\Roaming\Nunit\ was empty.

I copied the mirrored file from the \Users<user>\AppData\local\Nunit\ folder which looked complete and even without restarting Studio it started rediscovering the Nunit tests.

Hope this helps somebody.

Nick
  • 358
  • 2
  • 13