Visual Studio 2008测试视图面板未显示所有测试 [英] Visual Studio 2008 Test View Panel Not Showing All Tests

查看:91
本文介绍了Visual Studio 2008测试视图面板未显示所有测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组6个MSTest测试程序集.当我打开测试视图"窗口并按项目分组时,所有我的项目都会显示并保存一个.我似乎无法使Visual Studio理解该项目是一个单元测试程序集.

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的单元测试运行器可以毫无问题地确定第六个程序集.因此,从这个角度来看,组装就可以了.

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

Visual Studio 2008如何确定程序集是单元测试程序集?

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

我已经比较了csproj文件,没有发现任何异常.

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

推荐答案

在Visual Studio中创建测试"项目时,将以下元素添加到第一个PropertyGroup元素中的csproj xml中:

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>

如果您手动创建了测试程序集,比如说通过创建新的类库并添加对Microsoft.VisualStudio.QualityTools.UnitTestFramework的引用,则此元素将不在您的csproj文件中,Visual Studio将忽略所有位于的测试内部.

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.

这篇关于Visual Studio 2008测试视图面板未显示所有测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆