Search code examples
c#visual-studiodocumentation-generation

How do you get the XML documentation to show for a referenced C# library?


Suppose you have a C# library with several functions, all documented with the usual /// <summary> filled out nicely. Referencing the project will make the function and parameter description appear in the Visual Studio contextual help. But is it possible to have this show if you don't reference the project itself, just a build (and potentially some other file that has the documentation inside)?


Solution

  • Yes there is - the library needs to be built with the "XML Documentation file" tickbox checked (in the project property pages)

    alt text

    With this option ticked the build process will now build an extra XML file in the output directory which contains all of the xml documentation - whenever Visual Studio references an assembly by file it will load and show intellisense documentation from this XML file (if it can be found).

    alt text

    You should distribute this file alongside (in the same directory as) your compiled library.