Search Unity

how to show xml doc headers when people view your package's apis

Discussion in 'Package Manager' started by senfield, May 23, 2019.

  1. senfield


    Apr 1, 2019
    So, you can make visual studio generate an .xml of all your function header comments. Usually it's the same name as your dll and goes into the same directory with it.
    But how do we get that to happen when someone installs our package of source files?

    Right now, when I am using my package in a project and I click on an object to see all its definitions, I don't see any of my header comments.
    However, if I manually copy one of these .xml files made with visual studio to the Library/ScriptAssemblies directory then I can see the header comments.

    Is there a way to provide one of these .xml files in my package and have it automatically get to the right place when my assembly is built? Or in some way have these function header comments show up like they should?

  2. benoitv_unity


    Unity Technologies

    Aug 3, 2017
    Hi @senfield,

    When your package source code is compiled by Unity, the resulting assembly is output to "Library/ScriptAssemblies". At the moment, Unity does not pass the "-doc" flag to the compiler ( which explains why the documentation is unavailable. We do plan to support that in the future however.

    You could probably have an "InitializeOnLoad" that copies your documentation file to the "ScriptAssemblies" folder but I cannot really recommend that as anything under "Library" is under Unity's control.

    Hope this helps,
    senfield likes this.