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?
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.
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.
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.