Reputation: 12826
I've developed a code library which I have spent time documenting thoroughly.
The classes, methods and properties are comment using the triple-slash XML (xmldoc) comments.
/// <summary>
/// Adds two numbers together.
/// </summary>
/// <param name="a">The first number.</param>
/// <param name="b">The second number.</param>
/// <returns>The sum.</returns>
public int Add(int a, int b)
{
return a + b;
}
But when I compile this into a DLL file and reference it from my other project, or package it as a NuGet package that I reference, then Visual Studio / IntelliSense does not provide any documentation for my library.
Why is this, and what can I do about this?
Upvotes: 3
Views: 1279
Reputation: 12826
The compiler strips out all comments from the resulting comments, hence when directly referencing an assembly by its .DLL its not possible for IntelliSense to provide any documentation.
By enable to output a "XML documentation file" in the project properties the compiler outputs an .xml file in addition to the compiled .dll file.
When using NuGet to produce a package (done using dotnet pack -c release
) then it includes the XML documentation file if present, hence packages installed using NuGet provides documentation to IntelliSense if present.
Upvotes: 0
Reputation: 580
I'm not 100% sure if it will fix your issue but have you tried generating the xml doc file. if this is packaged with the dll it may be picked up by intelliSense.
Upvotes: 7