I have a product with multiple repositories, each distributed as a NuGet package. I would like to establish a separate repository for DocFx, which generates the documentation from the NuGet packages. That way, it can consolidate the documentation for multiple { repositories, projects, packages } into one location, while also allowing conceptual documentation to be updated independent of the package release cycle.
TL;DR: I am able to get DocFx to correctly generate the reference documentation based on the assemblies in the NuGet package, but it doesn't include any of the XML documentation (i.e., from ///
metadata). How do I solve this? Details below.
Source Package Configuration
To pursue this, I first ensured that the csproj
files for the source projects were configured to generate the XML documentation as part of the build output:
<Project>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
</Project>
And, as a result, the nupkg
file correctly includes the XML documentation at e.g.:
/lib/net6.0/{AssemblyName}.xml
This documentation is then picked up by e.g. Visual Studio IntelliSense when consuming these packages.
DocFx Configuration
I then added metadata
for these assembles via the docfx.json
configuration file:
{
"metadata": [
{
"src": [
{
"files": "bin/Release/net6.0/{AssemblyName}.dll"
}
],
"dest": "api/{AssemblyName}"
}
]
…
}
With this in place, DocFx correctly identifies the namespaces, types, and members, and generates reference documentation for each. So far, so good!
The Problem
The problem is that DocFx doesn't include any of the XML Doc (///
) information for these assemblies, despite them being included with the package. How do I mitigate this?