Build events can be used to invoke NDoc when build a VS.NET solution. Because NDoc builds can be time consuming it is recommended that they only be included in Release builds or in a special documentation build configuration.
Because build events for C# projects are not configuration based, it is necessary to check the configuration name if you do not want NDoc to run every time a build occurs. This can be accomplished using VS.NET's built in build variables:
if $(ConfigurationName) == Release
Because specifying all of NDoc's command line paramters directly in the build event editing window can be difficult and error prone, calling a batch file can be easier to manage and maintain. Use the Post-Build event for the last project in the solution that will be built or for each project for which you want seperate documentation.
Calling a batch file from the post-build event
For simple solutions the following batch file will invoke NDoc for each Release build.
IF NOT %1 == Release GOTO end "%ProgramFiles%\NDoc 1.3\bin\net\1.1\NDocConsole.exe" -recurse="%2bin\%1" :end
More complex solutions may require additional parameters such as reference directories etc.
NDoc can be included in builds orchestrated by any build tool that supports executing command line applications. The exact mechanism will be specific to the tool, but most (if not all) support arbitrary execution of executables with paramters.
NDoc development is hosted by