Cannot find any coverage data (.coverage or .coveragexml) files. Check test run details for possible errors

Joe picture Joe · Oct 15, 2010 · Viewed 9.9k times · Source

I am using Visual Studio Ultimate and I cannot get code coverage data. All of my unit tests pass, and I edited the Local.testsettings file to enable code coverage and configured it to reference the dll of my project. Also the active test setting is set to Local.testsettings and not TracAndTestImpact.testsettings.

Answer

Garry English picture Garry English · Mar 7, 2011

I had the same problem. I configured my .testsettings to include code coverage as detailed here: http://msdn.microsoft.com/en-us/library/dd504821(VS.100).aspx

What I was doing wrong is that I was running the test by pressing F5 in Visual Studio.

What I needed to do was double-click the ".vsmdi" file, which will open the "Test List Editor". Then I clicked the "Run Tests in Current Context" - (Ctrl+R, T) in the Test Code command bar. Code Coverage worked after that.

Hope this helps.