NCover Documentation

Tool Path

This option specifies the path to NCover on your system.

Usage:
ToolPath="C:\Program Files\NCover\"

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:
<NCover TestRunnerExe="nunit-console.exe" TestRunnerArgs="TestAssembly1.dll TestAssembly2.dll" />

Coverage Metric

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 "CoverageType" option.

Usage:
CoverageType="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 on/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

Makes NCover cover all 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

Try NCover Free Contact Us Online