简体   繁体   English

运行测试在 Visual Studio 中不可用

[英]Run Tests Unavailable in Visual Studio

Not strictly a programming question, but definately programming related.严格来说不是编程问题,但肯定与编程相关。

The option to run tests in Visual Studio is greyed out for some reason.由于某种原因,在 Visual Studio 中运行测试的选项显示为灰色。 I've just started a File |我刚刚开始一个文件 | new MVC Application, using VS2008pro.新的 MVC 应用程序,使用 VS2008pro。

alt text http://www.olympianbot.co.uk/images/greyed-tests.jpg替代文字 http://www.olympianbot.co.uk/images/greyed-tests.jpg

Any idea what causes this / how to resolve it?知道是什么原因造成的/如何解决?

Visual Studio recognizes test projects by a special GUID. Visual Studio 通过特殊的 GUID 识别测试项目。 If there's a project with the GUID: FAE04EC0-301F-11D3-BF4B-00C04F79EFBC , VS will automatically load tests from it.如果有一个 GUID FAE04EC0-301F-11D3-BF4B-00C04F79EFBC ,VS 会自动从中加载测试。 So make sure that in the.csproj of your test project you have the correct GUID:因此,请确保在测试项目的 .csproj 中具有正确的 GUID:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM