Search Unity

export code documentation in XML format using Visual Studio

Discussion in 'Code Editors & IDEs' started by ElBuho, Dec 4, 2015.

  1. ElBuho

    ElBuho

    Joined:
    Mar 9, 2015
    Posts:
    32
    Hi all.

    I'm using Visual Studio to code my game. I'm using XML labels to document my code (summary, param, ...).
    I want to export my documentation to a XML file using the Visual Studio options, but I don't get it to work.
    I enabled the option 'XML documentation file' on the compiler, but the XML file never appears.
    What am I doing wrong?

    Thank you in advance.
     

    Attached Files:

    • xml.PNG
      xml.PNG
      File size:
      18.7 KB
      Views:
      1,533
  2. Hawkins2k4

    Hawkins2k4

    Joined:
    Oct 6, 2013
    Posts:
    3
    Try removing temp from the file path. Also sometimes those setting get reset when the solution is reloaded.
     
  3. ElBuho

    ElBuho

    Joined:
    Mar 9, 2015
    Posts:
    32
    Thanks for your answer @Hawkins2k4, but the problem persists :( Any other ideas?
     
  4. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Is this for your own DLLs that you're creating in a separate project / solution? Unity doesn't use Visual Studio to do the compilation so if this is for your game project / Unity generated DLLs, it probably won't honor those flags.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Build your project in Visual Studio. You'll probably have to tell Visual Studio to include the UnityEngine assembly if you haven't done that already. Visual Studio will generate an XML file along with the build.

    Then you'll need to put that XML file through another tool such as Sandcastle to generate human-readable HTML or Windows Help files.

    Or just use Doxygen and tell it to scan the source files for your XML comments. This way you don't need to build in Visual Studio to create intermediate XML files.
     
    MentalGames and Dustin-Horne like this.
  6. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Sandcastle Help File Builder will also scan assemblies without requiring external XML content.
     
    TonyLi likes this.
  7. jbevain

    jbevain

    Microsoft

    Joined:
    Feb 22, 2012
    Posts:
    141
    Unity will generate new project files whenever there's a change, so your change will be lost at the next generation.
    As a workaround, you can move the code to a separate class library project where you'll control the project files, and the generation of the documentation.