views:

1178

answers:

1

I have a set of 6 MSTest test assemblies. When I bring up the Test View window and group by Project all of my projects show up save one. I cannot seem to make Visual Studio understand that this project is a unit test assembly.

Resharper's Unit Test Runner has no problem identifying this sixth assembly. So the assembly is fine from that stand point.

How does Visual Studio 2008 determine that an assembly is a unit test assembly?

I have compared the csproj files and found nothing out of the ordinary.

+10  A: 

When creating a "Test" project in Visual Studio, the following element is added to the csproj xml in the very first PropertyGroup element:

    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

If you created your test assembly by hand, say by creating a new Class Library and adding a reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework, this element will not be in your csproj file and visual studio will ignore all the tests located inside.

Add the element and all will be good again.

NotMyself
Thanks heaps for that! I just converted a set of NUnit tests to the Visual Studio runner and have been beating my head against this for an hour before finding your answer.
David Hall
glad I could help.
NotMyself
Nice find NotMyself. Thanks.
Konrad
Thanks! Works for VS2010 as well.
Simon Gillbee