NCover Documentation

Coverage Metric

Specify desired coverage metrics in a comma delimited list.

Usage:
//ct "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.
Note: This exclusion does not apply to properties.

Usage:
//ea System.Xml.Serialization.XmlElementAttribute

Exclude Assemblies

Complete Edition Feature

Assemblies matching the regular expressions will be excluded from coverage.
Note: The assembly name should not include the filename extension.

Usage:
//eas .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:
//ef "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:
//em ".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:
//et .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:
//ia 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).
Note: The assembly name should not include the filename extension.

Usage:
//ias .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:
//if "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:
//it .vendorsupplied.;Castle.

Disable Autoexclusion

Turn off auto-exclusion of compiler-generated code

Usage:
//na 

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:
//onlywithsource 

Process Name

When set NCover will cover all processes whose name is an exact (case-insensitive) match of the given process name. This argument can be specified multiple times if multiple distinctly named processes need to be covered.

Usage:
//pn svchost.exe //pn helloworld.exe

Cover All Processes

Makes NCover cover all processes that it starts either directly or indirectly.
Default: False

Usage:
//coverAll

Symbol Search Policy

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

Usage:
//ssp "SymbolServer, BuildPath"

If you still need technical assistance, we can help:

Submit A Support Ticket

Try NCover Free Contact Us Online