Fork me on GitHub
No tests were run because no tests are loaded

No tests were run because no tests are loaded

How to solve the horrid No tests were run because no tests are loaded or the selected tests are disabled error when trying to unit test in Visual Studio 2010.

This error is very confusing and a search of Google reveals nothing of much value. I had this issue today and finally figured the issue out.

Turns out that background discovery of new test methods was disabled. How that happened I have no idea, but here’s how to turn it back on.

Go to Tools > Options

Navigate to Test Tools > Test Project and ensure the Disable background discovery of test methods checkbox is unchecked.

Restart Visual Studio and enjoy being able to unit test again!

在VS的Unit Test中遇到“No tests were run because no tests are loaded or the selected tests are disabled.”提示信息。同时,Test View和Test List Editor中无法加载任何Test。解决方案是:删掉 [TestClass()]和[TestMethod()],编译,重新加上这些Attributes后再编译。

 

See Also
MS Test Re-Enabling Ignored Tests

How to: Disable and Enable Tests

 
 
分类: How to
posted on 2013-05-08 17:44  HackerVirus  阅读(391)  评论(0编辑  收藏  举报