-
Install package Roslynator.CommandLine
-
Add MSBuild Target to your csproj or vbproj file:
<Target Name="GenerateDocumentation" AfterTargets="RoslynatorInitialize" Condition=" '$(Configuration)' == 'Release'">
<!-- Execute 'generate-doc' command. This command will generate documentation files -->
<Exec Command="$(RoslynatorExe) generate-doc "$(SolutionPath)" ^
--msbuild-path "$(MSBuildBinPath)" ^
-o "$(SolutionDir)docs" ^
-h "API Reference""
LogStandardErrorAsError="true" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
</Exec>
<!-- Execute 'list-symbols' command. This command will generate list of symbol definitions -->
<Exec Command="$(RoslynatorExe) list-symbols "$(SolutionPath)" ^
--msbuild-path "$(MSBuildBinPath)" ^
--output "$(SolutionDir)docs\api.cs" ^
--visibility public"
LogStandardErrorAsError="true" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
</Exec>
</Target>
-
Build solution in Release configuration
-
Publish documentation to GitHub