Notice that NDepend.Console.exe returns a non-zero exit code when at least one Quality Gate fails. This exit code can be used to eventually stop your build process in such situation.
NDepend.Console.exe command line optionsMANDATORY
The path to the input .ndproj (or .xml) NDepend project file.
It must be specified as the first argument. If you need to specify a path that contains a space character use double quotes ".. ..". The specified path must be an absolute path, with drive letter C:\ or UNC \\Server\Share format.
Following arguments are OPTIONAL and can be provided in any order. Any file or directory path specified in optionals arguments can be:
- Absolute : with drive letter C:\ or UNC \\Server\Share format.
- Relative : to the ", productName, @" project file location.
- Prefixed with an environment variable with the syntax %ENVVAR%\Dir\
- Prefixed with a path variable with the syntax $(Variable)\Dir
- /ViewReport: to view the HTML report
- /Silent: to disable output and eventual calls to Console.Read() on console
- /HideConsole: to hide the console window
- /Concurrent: to parralelize analysis execution
- /LogTrendMetrics: to force log trend metrics
- /TrendStoreDir: to override the trend store directory specified in the NDepend project file
- /PersistHistoricAnalysisResult: to force persist historic analysis result
- /DontPersistHistoricAnalysisResult: to force not persist historic analysis result
- /ForceReturnZeroExitCode: to force return a zero exit code even when one or many quality gate(s) fail
- /HistoricAnalysisResultsDir: to override the historic analysis results directory specified in the NDepend project file.
/OutDir dir : to override the output directory specified in the NDepend project file.
VisualNDepend.exe won't work on the machine where you used NDepend.Console.exe with the option /OutDir because VisualNDepend.exe is not aware of the output dir specified and will try to use the output dir specified in your NDepend project file.
- /XslForReport xlsFilePath: to provide your own Xsl file used to build report
/InDirs dir1 [dir2 ...]: to override input directories specified in the NDepend project file.
This option is used to customize the location(s) where assemblies to analyze (application assemblies and third-party assemblies) can be found.
Only assemblies resolved in dirs are concerned, not assemblies resolved from a Visual Studio solution.
The search in dirs is not recursive, it doesn't look into child dirs.
Directly after the option /InDirs, the option /KeepProjectInDirs can be used to avoid ignoring directories specified in the NDepend project file.
/CoverageFiles file1 [file2 ...]: to override input coverage files specified in the NDepend project file.
Directly after the option /CoverageFiles, the option /KeepProjectCoverageFiles can be used to avoid ignoring coverage files specified in the NDepend project file.
- /CoverageDir dir: to override the directory that contains coverage files specified in the project file
/RuleFiles file1 [file2 ...]: to override input rule files specified in the NDepend project file.
Directly after the option /RuleFiles, the option /KeepProjectRuleFiles can be used to avoid ignoring rule files specified in the NDepend project file.
- /PathVariables Name1 Value1 [Name2 Value2 ...]: to override the values of one or several NDepend project path variables, or create new path variables.
/AnalysisResultToCompareWith: to provide a previous analysis result to compare with.
Analysis results are stored in files with file name prefix NDependAnalysisResult_ and with extension .ndar. These files can be found under the NDepend project output directory. The prefered option to provide a previous analysis result to compare with during an analysis is to use: NDepend > Project Properties > Analysis > Baseline for Comparison You can use the option /AnalysisResultToCompareWith in special scenarios where using Project Properties doesn't work.
- /Help: to display the current help on console
If you need to adjust the code queries execution time-out used during analysis through NDepend.Console.exe just run VisualNDepend.exe once on the machine running NDepend.Console.exe and choose a time-out value in VisualNDepend > Tools > Options > Code Query > Query Execution Time-Out.
This parameter is persisted in the file VisualNDependOptions.xml that can be found in the directory VisualNDepend > Tools > Options > Export / Import / Reset Options > Open the folder containing the Options File