Visual Studio 2008 Test View Panel Not Showing All Tests

放肆的年华 提交于 2019-12-08 19:28:15

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/273174/visual-studio-2008-test-view-panel-not-showing-all-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!