NCover Documentation

Program

This option specifies the path to NCover.Console.exe on your system.

Usage:
program="C:\Program Files\NCover\NCover.Console.exe"

Test Runner Exe

The test application that NCover should collect coverage data for. In many cases this is a unit test runner, like nunit-console.exe or MSTest.exe.

Note:In cases where IIS or Services are being covered, this argument can be used to specify a test application to use to test those services.

Usage:
testRunnerExe="nunit-console.exe"

Test Runner Args

The command line arguments for your test runner, as given with the testRunnerExe option.

Usage:
testRunnerArgs="TestAssembly1.dll TestAssembly2.dll"

Coverage Metrics

By default, NCover reports on all coverage metrics (permitted by the license). If you're not interested in all of the coverage metrics, you can restrict the metrics reported on using the "CoverageMetrics" option.

Usage:
coverageMetrics="Symbol, Branch, MethodVisits"

Allowed values: "Symbol","Branch","CyclomaticComplexity","MethodVisits"
Default value: "Symbol, Branch, MethodVisits, CyclomaticComplexity"

Exclude Attributes

Namespaces, Classes, and Methods with an attribute that matches one of the regular expressions will be excluded from coverage. The fully-qualified name of the attribute is used.

Usage:
excludeAttributes="System.Xml.Serialization.XmlElementAttribute"

Exclude Assemblies

Complete Edition Feature

Quick breakdown of what options are available

: Exclusion : Inclusion

Assembly : yes : yes Type : yes : yes Method : yes : NO Attribute : yes : yes Source File : yes : yes

By default, everything in every assembly loaded is included. Inclusions are always applied before exclusions (per type).

Usage:
excludeAssemblies=".vendorsupplied.;.tests"

Exclude Files

Source files whose path matches one of the regular expressions will be excluded from coverage. The full-path of the source file at compile-time is used.

Usage:
excludeFiles="D:\castletech\operations\dev\ncover\resources\setting.cs"

Exclude Methods

Methods whose fully-qualified name matches one of these regular expressions will be excluded from coverage.

Usage:
excludeMethods=".MyClass.Method1;.OtherNamespace.MyClass+InnerClass.Method2"

Exclude Types

Namespaces and classes whose fully-qualified name matches one of these regular expressions will be excluded from coverage (inner classes are separated from their parents by a '+' not a '.' e.g. namespace.class+innerclass).

Usage:
excludeTypes=".vendorsupplied.;.test"

Include Attributes

Complete Edition Feature

Namespaces, Classes, and Methods that don't have an attribute that matches one of the regular expressions will be excluded from coverage. The fully-qualified name of the attribute is used.

Usage:
includeAttributes="System.Xml.Serialization.XmlElementAttribute"

Include Assemblies

Assemblies that do not match a regular expression in this list will be excluded from coverage (the assembly name does not include the extension). If the list is empty, then all assemblies will be included into coverage (unless they are excluded for some other reason).<br /> Note: The assembly name should not include the filename extension.

Usage:
includeAssemblies=".vendorsupplied.;.tests"

Include File Paths

Complete Edition Feature

Source files whose path matches one of the regular expressions will be included into coverage. The full-path of the source file at compile-time is used.

Usage:
includeFiles="D:\castletech\operations\dev\ncover\resources\setting.cs"

Include Types

Complete Edition Feature

Namespaces and Classes whose fully-qualified name does not match one of these regular expressions will be excluded from coverage (inner classes are separated from their parents by a '+' not a '.' e.g. namespace.class+innerclass)

Usage:
includeTypes=".vendorsupplied.;Castle."

Disable Autoexclusion

Turn off auto-exclusion of compiler-generated code.

Usage:
includeAutoGenCode="true"

Only Assemblies With Source

By default, NCover will gather which coverage metrics it can from all loaded assemblies, including assemblies without source information available. Telling NCover to gather coverage only from assemblies with source will make it ignore assemblies that do not have source information available. However, if an assembly is included in the IncludedAssemblies list, then NCover will gather coverage information from that assembly, even if no source information is available.

Usage:
onlyAssembliesWithSource="true"

Process Name

When set, NCover will cover all processes whose name is an exact case-insensitive match of the given process name.

Usage:
coverChildProcess="svchost.exe"

Cover All Processes

Forces NCover to gather code coverage on all of the processes that it starts either directly or indirectly.
Default: False

Usage:
coverAll="true"

Symbol Search Policy

Set where NCover will search for PDBs for the assemblies it covers
Values: "Registry","SymbolServer","BuildPath","ExecutingDir"
Default Value: "Registry, SymbolServer, BuildPath, ExecutingDir"

Usage:
symbolSearchLocations="SymbolServer, BuildPath"

If you still need technical assistance, we can help:

Submit A Support Ticket