【问题标题】:How to use OpenCover plugin Visual Studio 2010如何使用 OpenCover 插件 Visual Studio 2010
【发布时间】:2014-01-18 00:37:20
【问题描述】:

我尝试生成代码覆盖率 xml 文件。但我失败了

添加 Nuget 包并在解决方案上启用 Nuget 包还原后。 然后打开 cmd 并运行此命令 .\packages\OpenCover.4.5.1604\OpenCover.Console.exe^ -注册:用户^ -目标:MSTest.exe^ -targetargs:"/noresults /noisolation /testcontainer:..\releases\Latest\NET40\MonitoredUndoTests.dll"^ -过滤器:+[]^ -输出:.\report\output.xml

但总是产生错误

【问题讨论】:

  • 错误是找不到目标“MSTest.exe”

标签: c# visual-studio-2010 opencover


【解决方案1】:

您应该尝试以下对我有用的链接。它说 Gallio 错误,但它使用 OpenCover 来运行覆盖。我将 Gallio 与 Sonar 一起使用并运行 OpenCover,并使用这些步骤解决了我的问题。

Gallio error : MSTest executable was not found

【讨论】:

  • 但是,我不使用声纳进行此覆盖,所以您希望它在没有声纳的情况下工作
  • 如果可以的话,请在 Skype 上加我讨论,请 osama.yasser@outlook.com 这是我的 Skype 帐户
  • 我无法使用 Skype...您是否尝试过该答案中提到的步骤?
  • 是的,在尝试了这些步骤之后。我试试这个命令 OpenCover.4.5.2316\OpenCover.Console.exe^ -register:user^ -target:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe"^ -targetargs :"/noresults /noisolation /testcontainer:C:\src\FileBound\source\V6.Core.Web\bin\FileBoundV6.dll"^ -filter:+[*]*^ -output:C:\report\output. xml 但我没有结果它说没有要执行的测试你有任何想法
  • 尝试查看覆盖创建的输出文件。您应该在那里看到错误消息。我认为它是一个 xml 文件。
猜你喜欢
  • 1970-01-01
  • 2011-02-07
  • 2011-07-08
  • 1970-01-01
  • 2013-09-29
  • 2011-09-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多