The custom MSBuild build tasks that shipped with NCover 3.0 had many differences and improvements from the NCover 2.1 version. Unfortunately, although the <NCover /> task remained backward compatible, the <NCoverExplorer /> task did not. Moreover, while the <NCover /> task is backward compatible, many of the properties were deprecated. This article will explain some of the common pitfalls and 'gotchas' encountered when upgrading from the NCover 2.1 MSBuild tasks to the NCover 3.0 MSBuild tasks.
Migrating an NCover 2.1 task to an NCover 3.0 task
Assemblies="@(Assemblies)" AssemblyList="" AutoExclude="" CommandLineArgs="" CommandLineExe="" CoverageFile="" CoverageHtmlDirectory="" CoverageType="" ExcludeAttributes="" FileExclusionPatterns="" LogFile="" LogLevel="" MethodExclusionPatterns="" ProfiledProcessModule="" ProfileIIS="" ProfileService="" ProjectName="" RegisterProfiler="" ServiceTimeout="" SymbolSearchPolicy="" // takes an int ToolPath="C:\Dev\NCover\Main\Debug" TypeExclusionPatterns="" WorkingDirectory="" />
The following task is equivalent to the one above and has been completely migrated to the NCover 3.0 format.
Assemblies="@(Assemblies)" IncludeAssemblies="" AutoExclude="" TestRunnerArgs="" TestRunnerExe="" CoverageFile="" HtmlReportDir="" CoverageType="" ExcludeAttributes="" ExcludeFiles="" LogFile="" LogLevel="" ExcludeMethods="" CoverChildProcess="" ProfileIIS="" ProfileService="" ProjectName="" RegisterProfiler="" ServiceTimeout="" SymbolSearchLocations="Registry, SymbolServer, BuildPath, ExecutingDir" ToolPath="C:\Dev\NCover\Main\Debug" ExcludeTypes="" WorkingDirectory="" />
Migrating an NCover 2.1 task to an NCover 3.0 task
Assembly *.Tests Assembly .*\.Tests True CoverageFiles="@(CoverageFiles)" Exclusions="$(CoverageExclusions)" FailCombinedMinimum="true" FailMinimum="true" Filter="" HtmlReportName="htmlreportname.html" MergeFileName="" MinimumCoverage="70" ModuleThresholds="@(ModuleThreshold)" OutputDir="" ProjectName="" ReportType="ModuleClassSummary" SatisfactoryCoverage="80" SatisfactoryFunctionCoverage="96" ShowExcluded="true" Sort="" XmlReportName="xmlreportname.xml" />
The following task is equivalent to the one above and has been completely migrated to the NCover 3.0 format.
Assembly *.Tests Assembly .*\.Tests True SymbolCoverage View 70 SymbolCoverage Module 70 MethodCoverage View 96 SymbolCoverage View 80 SymbolCoverage MyProject.1.dll Module 75 SymbolCoverage MyProject.2.dll Module 85 SymbolModuleNamespaceClass Xml xmlreportname.xml SymbolModuleNamespaceClass Html htmlreportname.html
Conversion examples: v2.1 "Exclusions" to v3.0 "CoverageFilters"
Assembly *.Tests Assembly .*\.Tests True
The v2.0 project above is equivalent to the v3.0 project below.
Assembly *.Tests Assembly .*\.Tests True
The v2.0 project above is equivalent to the v3.0 project below.
Assembly *.Tests Namespace TestNamespace.* Class MyNamespace.OutputClasses*
Conversion examples: v2.1 report functionality to v3.0 "Reports"
The v2.0 project above is equivalent to the v3.0 project below.
MethodModuleNamespaceClassMethod Xml reportforccnet.xml
The v2.0 project above is equivalent to the v3.0 project below.
SymbolModuleNamespace Html \summary.xml SymbolModuleNamespace Xml \summary.html
OutputDir="\coverage\reports\build4356" />
The v2.0 project above is equivalent to the v3.0 project below.
FullCoverageReport
Conversion examples: v2.1 "SatisfactoryCoverage" to v3.0 "SatisfactoryCoverage"
The v2.0 project above is equivalent to the v3.0 project below.
SymbolCoverage 65
The v2.0 project above is equivalent to the v3.0 project below.
MethodCoverage 45
The v2.0 project above is equivalent to the v3.0 project below.
SymbolCoverage 45 MethodCoverage 100
The v2.0 project above is equivalent to the v3.0 project below.
SymbolCoverage 77 SymbolCoverage Module project1.dll 45 SymbolCoverage Module project2.dll 67
The v2.0 project above is equivalent to the v3.0 project below.
SymbolCoverage 77 SymbolCoverage Module project1.dll 45 SymbolCoverage Module project2.dll 67
Conversion examples: v2.1 "MinimumCoverage" to v3.0 "MinimumCoverage"
The v2.0 project above is equivalent to the v3.0 project below.
SymbolCoverage 70
The v2.0 project above is equivalent to the v3.0 project below.
SymbolCoverage 75 Module
The v2.0 project above is equivalent to the v3.0 project below.
SymbolCoverage 45 SymbolCoverage Module 45