Code coverage is used to check how much of your code is covered by unit test. When you run “Analyze Code Coverage for All Tests” from Test Explorer of your visual studio, it will first build your solution, then run all the associated tests and then show the code coverage in “Code Coverage Results” window. But what if your Code Coverage results is empty? This will result in an empty .coverage file.
There are many ways to troubleshoot this issue. For some people it will work by just deleting the .suo file from your project solution’s root directory and restarting VS. For some people it works by just removing or adding a test method.
Even that does not work always. In that case the best way to deal with this issue is to check your Event Viewer for a “TraceLog Profiler” error around the same time when you run your code coverage.
“The description for Event ID 5 from source TraceLog Profiler cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
If you see an error something like above then check for below things and correct accordingly.
a) Environment variable VS110COMNTOOLS is set to <vsinstalldir>\common7\tools
(VS110COMNTOOLS is for VS2012 and VS120COMNTOOLS is for VS2013)
b) Regkey HKLM\SOFTWARE\Microsoft\VisualStudio\11.0\InstallDir is set to your <vsinstalldir>\Common7\IDE\
c) covrun32.dll or covrun64.dll exist in “<vsinstalldir>\Team Tools\Dynamic Code Coverage”