NCover Documentation

Coverage Metrics

Specify desired coverage metrics in a comma delimited list.

Usage:
<CoverageMetrics>Symbol, Branch, MethodVisits<CoverageMetrics>

Allowed values: "Symbol","Branch","CyclomaticComplexity" or "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><Attribute>System.Xml.Serialization.XmlElementAttribute</Attribute></ExcludeAttributes> 

Exclude Assemblies

Complete Edition Feature

Assemblies matching the regular expressions will be excluded from coverage.

Usage:
<ExcludeAssemblies><Assembly>.vendorsupplied.</Assembly></ExcludeAssemblies>

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><SourceFile>D:\castletech\operations\dev\ncover\resources\setting.cs</SourceFile></ExcludeFiles>

Exclude Methods

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

Usage:
<ExcludeMethods><MethodName>.MyClass.Method1</MethodName><MethodName>.OtherNamespace.MyClass+InnerClass.Method2</MethodName></ExcludeMethods>

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><TypeName>.vendorsupplied.</TypeName><TypeName>.test</TypeName></ExcludeTypes>

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><Attribute>System.Xml.Serialization.XmlElementAttribute</Attribute></IncludeAttributes>

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).

Usage:
<IncludeAssemblies><Assembly>.vendorsupplied.</Assembly><Assembly>.tests</Assembly></IncludeAssemblies>

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><SourceFile>D:\castletech\operations\dev\ncover\resources\setting.cs</SourceFile></IncludeFiles>

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><TypeName>.vendorsupplied.</TypeName><TypeName>Castle.*</TypeName></IncludeTypes>

Disable Autoexclusion

Turn on/off auto-exclusion of compiler-generated code

Usage:
<IncludeAutoGenCode>true</IncludeAutoGenCode>

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</OnlyAssembliesWithSource>

Process Name

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

Usage:
<CoverChildProcess>svchost.exe</CoverChildProcess>

Cover All Processes

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

Usage:
<CoverAll>True</CoverAll>

Symbol Search Locations

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</SymbolSearchLocations>

If you still need technical assistance, we can help:

Submit A Support Ticket