I'm using OpenCover to generate test coverage reports for my projects, but it's not generating any data. Checking in my logs, it's showing "missing pdb" for the dlls in question, however the pdbs are available in the same directory.
Things I've tried:
- I've tried adding the directories with the pdbs in explicitly using the -searchdirs option - makes no difference.
- I've checked and it looks like XUnit doesn't do shadow copying of dlls, so they are being accessed from the right directory. The opencover results.xml backs me up on this.
I'm using a command line of
opencover.console -oldstyle -register:user
-target:"C:\Program Files\Dotnet\dotnet.exe"
-targetargs:"test"
-searchdirs:"C:\dev\public\hermes-c#\Hermes.Server\Hermes.AspNetCore.Test\bin\Debug\netcoreapp1.0"
Any and all thoughts appreciated!
.NET Core uses a "Portable PDB" format by default, which OpenCover does not understand yet.
Try the following build options instead:
Note: when using
full
the generated debug symbols are for Windows only...Update: with MSBuild based projects this becomes:
And, we're able to build using the
/p:DebugType=Full
switch too. Thus, the "ordinary" build can use the default debug setting, but a "special" build for coverage analysis can change that to full.