Solving Case of Missing Tests

Illustration

I was quite surprised when Visual Studio 2012 could not run any unit tests for one project of mine. Every time I would hit rebuild, same output would appear “Exception has been thrown by the target of an invocation.” and Test Explorer would stay empty.

Solution that worked for me was just deleting whole TestResults directory. One rebuild after, Test Explorer was full once more.

How did this corruption occur is different matter completely. Since this project was converted from Visual Studio 2010 it might be something in conversion process gone wrong. Or it might have been some disk error. Or my habit of interrupting build process finally got me. I will probably never know.