6

I am using the plugin code cover in visual studio 2015 community to know the code coverage of the code projects.

When I tried to use the plugin I received this error message: "pen cover not found. Please select the open cover executable."

I've installed the opencover.4.6.519 and the plugin in visual studio.

Yaz
  • 492
  • 1
  • 6
  • 20

3 Answers3

2

I just had the same issue, so I thought I would add how I resolved it. I needed to install OpenCover and Nunit on my machine in order for OpenCover to work in VS. Installing just the vsix package for OpenCover isn't going to do it. Go to their respective websites and download the msi files for each. Then run OpenCover again in VS. It had no problem finding Nunit, but OpenCover installed in C:\Users{yourUserName}\AppData\Local\Apps\ so I had to point it to there. Then it worked.

Doug F
  • 894
  • 2
  • 13
  • 18
0

OpenCover commandline arguments can be given through a config file. The plugin expects a directory named OpenCover to be present in the base solution folder and a file named OpenCover.UI.config be present in it. Sample structure of the file is given below.

<Root>
    <Parameters>
        <Parameter name='enableperformancecounters'>true</Parameter>
         <Parameter name='excludebyattribute'>*.ExcludeFromCodeCoverage*</Parameter>
    </Parameters>
</Root>

This will ensure that the commandline arguments enableperformancecounters and excludebyattribute be added to the commandline arguments while running OpenCover.

0

To solve this problem look for OpenCover.Console.exe, which is likely within your packages folder, and nunit-console.exe which is also in the packages folder under Nunit.Runners.xxxx\tools

Copy the path of each file, and in your solution go to Tools > Options and find on the left hand side OpenCover.UI Options.

Put the two paths into the boxes and press OK, and it should resolve the issue.

I am not sure if there are any consequences for linking to the executable within the packages folder.

NibblyPig
  • 51,118
  • 72
  • 200
  • 356