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

时间:2009-11-16 10:04:58

标签: .net ncover ncover-explorer

进行了一些重构后,我发现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

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

1 个答案:

答案 0 :(得分:1)

此错误已在最新(未发布)版本中修复。如果您通过电子邮件向NCover支持(http://www.ncover.com/support)发送电子邮件,他们会向您发送修复程序。