[Bug] Metadata extracted from DLL does not include triple slash comments
Describe the bug When I create a doc site using DocFx I get different results if I reference a DLL versus a CSPROJ. Using the DLL as a metadata source looses the '///' comments
To Reproduce Steps to reproduce the behavior:
- Clone the repository at BlazorBounce
- From the root run ServeDocs
- Observe the output, there are no /// comments
- Change the source spec to be the csproj
- Run ServeDocs again
- Observe /// comments
Expected behavior I expect the output to be the same or that documentation be added that states that /// comments aren't available when metadata is extracted from a DLL
Context (please complete the following information):
- OS: Windows 11
- Docfx version: 2.77.0
Additional context Add any other context about the problem here.
When generating API metadata from DLLs. It requires documentation XML files to extract comments.
What would happen if the following lines were added to .csproj.
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
@filzrev
That works, however:
-
Why does specifying the csproj as input work without having that entry?
-
This 'hint' needs to be added to the DocFx documentation
Thanks for the help...
Why does specifying the csproj as input work without having that entry?
When generating docs from csproj.
docfx run code analysis to C# source code. (It's executed on memory. and DLL is no generated)
So separated documentation xml files are not needed.
On the contrary, when generating docs from DLL files. docfx manually loading documentation xml files. https://github.com/dotnet/docfx/blob/4d5949af96797a34d418f3fcb6b31f63392df5de/src/Docfx.Dotnet/CompilationHelper.cs#L201C2-L201C21
@filzrev
Thanks very much for explaining the difference in the two methods.
I think all that is needed now is a minor documentation update.