VSdocman can be called from a command line. However, you always need to configure your project settings in the IDE. Before trying VSdocman from the command line, test it from the IDE first.
To compile documentation from the command line, you need to call VSdocmanCmdLine.exe utility located in VSdocman installation folder.
Syntax
VSdocmanCmdLine.exe [/?] [/devenvPath "DEVENV_EXE_PATH"]
[/operation compileProject | compileSolution | compileSolutionToSingle]
[/profile "PROFILE_NAME"]
[/outputPath "OUTPUT_PATH"]
[/retryOnCpuBusy RETRY_COUNT;INTERVAL]
[/solutionLoadedWait SECONDS]
"PROJECT_OR_SOLUTION"
Command Line Parameters
Parameter |
Description |
PROJECT_OR_SOLUTION |
A full absolute path to the project file (.csproj, .vbproj, ...) if the operation is compileProject. Otherwise it is a full path to the solution file (.sln). |
/devenvPath |
The full path to the devenv.exe to be used internally. This parameter must be used, because there may be multiple instances installed, even of the same VS version. |
/operation |
Operation to perform. There are three choices: •compileProject - compiles a single project •compileSolution - compiles each project in a solution into separate documentation. •compileSolutionToSingle - compiles entire solution into a single documentation. The settings from the solution-wide common properties, that were selected in the IDE the last time the "Compile Solution to Single Documentation" was executed, will be applied. |
/profile |
Profile name used. If the operation is compileProject, it must be a project profile name. Otherwise it is a solution profile name. The name must be enclosed in double quotes. If this parameter is omitted, the "default" profile will be used. |
/outputPath |
The full path to the directory where the documentation will be generated. Specify this argument only if you want to generate the output to a location that is different from the output path saved in the profile (the project properties set in the GUI). |
/retryOnCpuBusy |
Specifies if the utility should retry when the operation fails due to a high CPU load. In very rare cases, it may happen that the utility exits with the error code 1 (Visual Studio was not found) with the additional exception info: COMException (0x80080005). This is usually caused by the current high CPU load. On the next execution everything works. This parameter specifies how many times and with what intervals in seconds should the utility retry automatically in such cases. The values are separated by a semicolon. If you encounter this problem, set the parameter to something like this: /retryOnCpuBusy 3;60 |
/solutionLoadedWait |
The additional time in seconds, for which the utility will wait to make sure the solution/project is really loaded. This is needed only for SDK style projects (.NET Core projects and .NET Standard projects), where there is a confirmed issue in Visual Studio. A solution is loaded in the background and the code model needed by VSdocman is still null and there's no way to detect when it is ready. This was still not resolved in VS 2019 16.1.4 and will probably never be in VS 2017.
This problem shows itself in that the generated documentation is empty, only custom topics are generated but no code documentation is compiled. As a temporary workaround, you can instruct the utility to wait for several seconds after a solution is loaded and before the compilation starts. 3 to 10 seconds should be enough in most cases. |
/? |
Show help. |
Exit Codes
Code |
Description |
0 |
OK |
1 |
Visual Studio (version specified by /devenvPath parameter) was not found. |
2 |
Incorrect command line parameters. |
3 |
Other error. |
Examples
To compile documentation for an entire solution to a single resulting documentation, the "default" profile will be used: VSdocmanCmdLine.exe /devenvPath "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" /operation compileSolutionToSingle /retryOnCpuBusy 3;60 "C:\SLN\solution.sln"
To compile documentation for one project: VSdocmanCmdLine.exe /devenvPath "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" /operation compileProject /profile "My project profile" /retryOnCpuBusy 3;60 "C:\SLN\PRJ\project.csproj"
This is the BAT file which compiles documentation for one project, saves all output and error messages in vsdocman.log file and checks the exit code:
|