Wednesday, June 21, 2006

C# Documentation using Doxygen

C# has its own document generator which generates XML documentation from source code comments. But I'm a C++ guy for the most part
of my life and grew up with Doxygen. So I tried Doxygen on a small C# project.

Here is the configuration file I started with

csdoxy.conf
-----------
PROJECT_NAME = "GA C# Port"
OUTPUT_DIRECTORY = html
WARNINGS = YES
INPUT = mysuperprojectdir
FILE_PATTERNS = *.cs
PERL_PATH = /tp/bin/perl
SEARCHENGINE = NO

And I invoked doxygen just giving the above configuration file.

doxygen csdoxy.conf
The C# project had the M$ recommended way of source documentation. It was OK for the most part. But still the result was not what I
expected. Then I came across this C# input filter.
I downloaded it and saved in the same place where I had the configuration file and added these two lines to the configuration
file

INPUT_FILTER = "python doxyfilter.py"
FILTER_SOURCE_FILES = YES

and the world is a much better place now!

2 comments:

Jeff Tanner said...

Even though you had posted this 2+ years ago, I have a couple of questions:

Where do place csdoxy.conf file?

PROJECT_NAME = "GA C# Port"
Is this Visual Studio project/solution name?

INPUT = mysuperprojectdir
What directory is this referring, Visual Studio project directory name?

PERL_PATH = /tp/bin/perl
Does Doxygen upon Windows workstation require Perl?

/E said...

You can place csdoxy.conf file anywhere, but when you invoke doxygen make sure you include full path to it.
doxygen <path>/csdoxy.conf

PROJECT_NAME is the tile of your project that appears in the documentation header.

INPUT is where your sources live. It could be your VS project directory if you store your source files there. If you refer them from a elsewhere (like source control location) include that location.