MSTest Not Finding New Tests

I ran into the same problem with not discovering new test methods after I had uninstalled ReSharper and updated to Visual Studio 2010 SP1.

I fixed the issue by going to Tools > Options > Test Tools > Test Project and unchecked "Disable background discovery of test methods".

It worked re-opening the solution but not doing a full clean and rebuild.


For me nothing of the above worked. I compared my csproj file with one that worked and added the project type guids from the other test project to the one that didn't work.

So try to add the type Guids to your project file where the [TestClass] and [TestMethod] is included with a text editor:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
...
    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    </PropertyGroup>
...
</Project>

After adding this and a refresh in the test list editor I instantly saw my tests and CTRL-R-T worked.

Regards, Michael


Simplest way: Reopen the solution.

You can also open your test list file (the "vsmdi" file in your Solution Items folder) and hit the "refresh" button there.

A full rebuild of your solution works sometimes, too.