NCover Documentation

Assemblies

Usage: //assemblies [assembly names] or //a [assembly names]

This command-line argument specifies the assemblies that you want to analyze. NCover can only provide sequence point coverage for assemblies that have .pdb files included with them. If you do not specify the //a argument, NCover will attempt to analyze every loaded assembly that has debug information available. Note that the assembly name arguments are the module name within the assembly, not the physical file name. e.g. "MyAssembly" rather than "MyAssembly.dll".

Example: NCover.Console MyApp.exe //assemblies "MyFirstAssembly;MySecondAssembly" or NCover.Console MyApp.exe //a "MyFirstAssembly;MySecondAssembly"

Coverage Type

Usage: //coverage-type [None, SequencePoint, Branch] or //ct [None, SequencePoint, Branch]

Return only the coverage data requested.

  • None: only shows methods
  • SequencePoint: shows sequence point data as well as methods
  • Branch: shows branch point data as well as methods. This is only available in the Enterprise edition.

By default, NCover provides all coverage data.

Example: NCover MyApp.exe //coverage-type Branch or NCover MyApp.exe //ct Branch

Exclude Attributes

Usage: //exclude-attributes [attributes] or //ea [attributes]

You can choose to exclude classes and methods from coverage statistics by defining .NET attribute(s) and applying it to the affected code. When using this argument you must specify the full type namespace of these attribute(s) separated by semi-colons. See below for an example.

Example: NCover.Console MyApp.exe //exclude-attributes MyNamespace.CoverageExcludeAttribute or NCover.Console MyApp.exe //ea MyNamespace.CoverageExcludeAttribute

Exclude Files

Usage: //exclude-files [file regex list] or //ef [file regex list]

You can choose to exclude source files from coverage statistics by providing a list of regular expressions that match the filenames that you wish to exclude, separated by semi-colons. See below for an example.

Note: The expressions used for matching filenames are regular expressions, not just typical filename wildcard matches. So, for example: NCover.Console MyApp.exe //ef .cs is not valid, and the regular expression will be ignored. The correct regular expression syntax would be: NCover.Console MyApp.exe //ef ..cs

Note: The expressions are matched against the absolute path and filename of the loaded files, not just their filename without the path.

Example: NCover.Console MyApp.exe //exclude-files "MyAppIgnored..cs;MyAppAlsoIgnored..cs" or NCover.Console MyApp.exe //ef "MyAppIgnored..cs;MyAppAlsoIgnored..cs"

Exclude Types

Usage: //exclude-types [type regex list] or //et [type regex list]

You can choose to exclude classes and types from coverage statistics by providing a list of regular expressions that match the types that you wish to exclude, separated by semi-colons. See below for an example.

Note: The expressions used for matching type names regular expressions, not just typical wildcard matches. So, for example: NCover.Console MyApp.exe //et App is not valid, and the regular expression will be ignored. The correct regular expression syntax would be: NCover.Console MyApp.exe //et .App

Example: NCover.Console MyApp.exe //exclude-types "MyAppIgnored.;MyAppAlsoIgnored." or NCover.Console MyApp.exe //et "MyAppIgnored.;MyAppAlsoIgnored."

Exclude Methods

Usage: //exclude-methods [method regex list] or //em [method regex list]

You can choose to exclude methods from coverage statistics by providing a list of regular expressions that match the methods that you wish to exclude, separated by semi-colons. See below for an example.

Note: The expressions used for matching method names are regular expressions, not just typical wildcard matches. So, for example: NCover.Console MyApp.exe //et ain is not valid, and the regular expression will be ignored. The correct regular expression syntax would be: NCover.Console MyApp.exe //et .ain

Example: NCover.Console MyApp.exe //exclude-methods "Ignored.;AlsoIgnored." or NCover.Console MyApp.exe //em "Ignored.;AlsoIgnored."

Disable Autoexclusion

Usage: //na

By default, NCover automatically ignores sequence points that do not map to source code or branch points while collecting data. Their existence is still noted in the XML output, but a visited count is not kept. If you need to know if these points are being executed, use the //na flag to collect data on them.

Example: NCover.Console MyApp.exe //na

Process Module

Usage: //pm [process module name]

This setting tells NCover to ignore processes that don't have the specified process module name. This is the name of the executable (i.e. myapp.exe). This setting is useful in cases where your NCover command spawns a series of child processes. Using this setting will help NCover determine which process to profile.
The child process executable name is case-insensitive, and should include the .exe extension.

Example: NCover.Console MyApp.exe //pm Child.exe

Symbol Search Policy

Usage: //ssp [search policy integer]

Sometimes, you may need to modify the Symbol Search Policy. To do this, you can use the //ssp flag with a parameter that defines which attributes to apply. To determine what this parameter should be, consult the table below and add up the values for all attributes you wish to enable.

Value Name Description
1 AllowRegistryAccess Queries the registry for symbol search paths
2 AllowSymbolServerAccess Accesses a symbol server
4 AllowOriginalPathAccess Searches the path speicifed in the Debug directory
8 AllowReferencePathAccess Searches for the PDB in the place where the .exe file is

Example: NCover.Console MyApp.exe //ssp 12

If you still need technical assistance, we can help:

Submit A Support Ticket