Generating XML Documentation (VS2015)

Hello,

I have a Visual Studio 2015 (Community) project, that consists of a single header. (As soon as the header contains functionality I will add Unit Tests so there is something to compile ;)

For code documentation I want to give the XML Documentation a try (see https://msdn.microsoft.com/en-us/library/ms177226.aspx ). Usually I use doxygen.

The header contains a test function which is documented using <summary>, <param>, and <returns>.

Visual Studio shows the documentation in a proper format, when I use this function somewhere else. So far so good.

Not I want to build the documentation XML file. According to the link above I have to compile with /doc... But here I get stuck. I cannot get Visual Studio to generate the documentation for me, the command line cl my_file.hpp /doc does not work either. I guess cl.exe tries to compile something. But I only want it to create the .xdc file.

Does somebody have an idea or a tutorial how to generate the XML doc file. I would also like to get a html documentation afterwards. Is that possible?

Thanks in advance,
Mathes
Setting Properties->Configuration Properties->C/C++->Generate XML DOC Files to yes creates a .xml in VS2013 CE - maybe you need to do a complete rebuild.
Hello Thomas,

that does not work. The flag is set, but I do not get the xml.

I tried it for my header only and with a simple .cpp file that includes the header.
Both times I get no doc output from VS.

But if I try cl main.cpp /doc it puts out a .xdc that I can then process with xdcmake.

Anyway, now I know a way to get the xml file.

But I am not happy with the way it works. Why must I compile something, to generate the documentation?

Regards,
Mathes
Why must I compile something, to generate the documentation?


Very good question. In .NET it makes sense since the documentation is created from the .exe or .dll but for native C++ ???
Anyway I also tried and decided to stick with Doxygen.
Topic archived. No new replies allowed.