OpenCover 找不到解决方案模块

OpenCover not finding solution modules

我正在尝试使用 OpenCover 为我的解决方案生成一些代码覆盖率报告。我从这个博客 post http://www.allenconway.net/2015/06/using-opencover-and-reportgenerator-to.html 得到了 运行 帮助,但它目前没有识别和加载我想要报告的模块。

这是我正在执行的:

"%~dp0..\packages\OpenCover.4.7.922\tools\OpenCover.Console.exe" ^
-register:user ^
-target:"C:\Program Files (x86)\Microsoft Visual Studio17\Professional\Common7\IDE\mstest.exe" ^
-targetargs:"/testcontainer:\"%~dp0..\My.Project_Tests\bin\Debug\My.Project_Tests.dll\" /resultsfile:\"%~dp0My.Project.trx\"" ^
-filter:"+[My.Project*]* -[My.Project_Tests]*" ^
-mergebyhash ^
-skipautoprops ^
-output:"%~dp0\GeneratedReports\WebsiteReport.xml"

我得到的输出:

No tests to execute.
Committing...
No results, this could be for a number of reasons. The most common reasons are:
1) missing PDBs for the assemblies that match the filter please review the
output file and refer to the Usage guide (Usage.rtf) about filters.
2) the profiler may not be registered correctly, please refer to the Usage
guide and the -register switch.

我试过更改过滤器以包含所有内容:

-filter:"+[*]*"

这会发现并报告测试项目中的代码覆盖率,但无法识别或报告我实际想要测试的任何引用项目中的覆盖率 (My.Project)。

正在构建所有项目,.pdb 文件存在于测试项目的 bin 文件夹中。

我想要我的测试项目引用的所有项目的代码覆盖率报告。有谁知道出了什么问题吗?

事实证明我是个白痴,当我应该是 运行 NUnit 控制台时我是 运行 MSTest,因为我们的测试都使用 NUnit。

发布这个以防万一它能帮助别人。