如何修复 NCover“添加了重复方法”的问题错误

发布于 2024-08-12 03:45:07 字数 2404 浏览 8 评论 0原文

进行了一些重构后,我现在发现 NCoverExplorer 无法合并我的测试结果。使用 NCover 和 NCoverExplorer v3.2.2,合并似乎可以工作,但 NCoverExplorer 将无法打开合并的文件,并显示错误,提示该文件不存在或无法打开(它确实存在并且可以打开)。

因此,我尝试使用 NCover 1.5.8,当 NCoverExplorer 3.2.2 尝试合并文件时,我收到以下更有用的错误:

NCoverExplorer.Console Complete v3.2.2 x86 (Administrator)
(c) 2007 - 2009 Gnoso Inc.
http://www.ncover.com/

Processing report settings from the command line.

-- Top-level exception (System.Exception)
An error occurred while loading your coverage file: Duplicate method was added.
-- Stack Trace
   at NCover.Framework.Reports.ReportingProcessor.CreateCoverageView(List`1 filenames, ICoverageReportSettings sett)
   at NCover.Framework.Reports.ReportingProcessor.Process()
   at NCoverExplorer.Console.EntryPoint.Main(String[] args)
-- Inner exceptions
Duplicate method was added.
-- Stack Trace
   at NCover.Framework.Models.NCover2.NCover2CoverageClass.CreateMethod(String name, String signature, Int32 cyclomaticComplexity, Boolean doNotAppend)
   at NCover.Framework.Models.NCover2.NCover2CoverageClass.CreateMethod(String name, String signature, Int32 cyclomaticComplexity)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessMethods(ICoverageModelClass destClass, ICoverageModelClass sourceClass, Dictionary`2 documentMa
p, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessClasses(ICoverageModelModule destModule, ICoverageModelNamespace destNs, ICoverageModelNamespac
e sourceNs, Dictionary`2 documentMap, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessNamespaces(ICoverageModelModule destModule, ICoverageModelModule sourceModule, Dictionary`2 doc
umentMap, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessModules(ICoverageModel model, Dictionary`2 documentMap, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel..ctor(ICoverageModel model, MergeFilterMode mode)
   at NCover.Framework.Utilities.CoverageLoader.Merge(ICoverageView originalView, List`1 paths, MergeFilterMode mode)
   at NCover.Framework.Utilities.CoverageLoader.Merge(List`1 paths, MergeFilterMode mode)
   at NCover.Framework.Reports.ReportingProcessor.CreateCoverageView(List`1 filenames, ICoverageReportSettings sett)


Exiting with return code: 2

如何解决此错误?线索就在那里 - 查看 CreateMethod() 的 namesignature 参数可能会有很大帮助。

Having performed some refactoring I am now finding that NCoverExplorer is unable to merge my test results. With NCover and NCoverExplorer v3.2.2 the merge appeared to work, but NCoverExplorer would fail to open the merged file with an error suggesting that the file didn't exist or couldn't be opened (which it did and could).

So I tried with NCover 1.5.8 and I get the following, more helpful error from NCoverExplorer 3.2.2 when it tries to merge the files:

NCoverExplorer.Console Complete v3.2.2 x86 (Administrator)
(c) 2007 - 2009 Gnoso Inc.
http://www.ncover.com/

Processing report settings from the command line.

-- Top-level exception (System.Exception)
An error occurred while loading your coverage file: Duplicate method was added.
-- Stack Trace
   at NCover.Framework.Reports.ReportingProcessor.CreateCoverageView(List`1 filenames, ICoverageReportSettings sett)
   at NCover.Framework.Reports.ReportingProcessor.Process()
   at NCoverExplorer.Console.EntryPoint.Main(String[] args)
-- Inner exceptions
Duplicate method was added.
-- Stack Trace
   at NCover.Framework.Models.NCover2.NCover2CoverageClass.CreateMethod(String name, String signature, Int32 cyclomaticComplexity, Boolean doNotAppend)
   at NCover.Framework.Models.NCover2.NCover2CoverageClass.CreateMethod(String name, String signature, Int32 cyclomaticComplexity)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessMethods(ICoverageModelClass destClass, ICoverageModelClass sourceClass, Dictionary`2 documentMa
p, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessClasses(ICoverageModelModule destModule, ICoverageModelNamespace destNs, ICoverageModelNamespac
e sourceNs, Dictionary`2 documentMap, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessNamespaces(ICoverageModelModule destModule, ICoverageModelModule sourceModule, Dictionary`2 doc
umentMap, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessModules(ICoverageModel model, Dictionary`2 documentMap, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel..ctor(ICoverageModel model, MergeFilterMode mode)
   at NCover.Framework.Utilities.CoverageLoader.Merge(ICoverageView originalView, List`1 paths, MergeFilterMode mode)
   at NCover.Framework.Utilities.CoverageLoader.Merge(List`1 paths, MergeFilterMode mode)
   at NCover.Framework.Reports.ReportingProcessor.CreateCoverageView(List`1 filenames, ICoverageReportSettings sett)


Exiting with return code: 2

How do I go about resolving this error? The clues are there - seeing the name and signature parameters to CreateMethod() would probably help a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不乱于心 2024-08-19 03:45:07

此错误已在最新(未发布)版本中修复。如果您向 NCover 支持人员发送电子邮件 (http://www.ncover.com/support),他们会发送你解决一下。

This bug has been fixed in the most recent (unreleased) version. If you email NCover support (http://www.ncover.com/support) they'll send you a fix.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文