Using .NET Custom Attributes for release documentation

posted on 09/26/07 at 07:24:01 pm by Joel Ross

One of the things that I've struggled with as a developer is keeping documentation in synch with the code I'm writing. To alleviate that, I'm always looking at ways I can represent documentation in my code. For example, at NuSoft, we have a basic set of coding guidelines we want to follow. We have a document, but I'm guessing that everyone looked at it when we first rolled it out - and probably not looked since. But that's OK - our framework follows our standards completely - the standards document was written with the framework in mind. So, whenever a developer starts on a project that uses the framework, they see our coding standards in practice. And I've seen developers' coding styles change as a result.

Anyway, along that same line, Waldek Mastykarz has a cool post about using attributes to generate release notes. Basically, he's built a few custom attributes to decorate classes, methods, properties, etc. to show why work was done. You can flag it as a Change, Bug or Feature, include a description, date, version and/or initials, depending on what the change type is. Then, you can generate your release notes from that information.

This is a little more customized, but it would be nice to also have versions in bug fixes and changes, so you could then create release documentation separated by new features, changes and bug fixes. Luckily, he's released the source, so I could do this myself.

It might be time to start looking into better documentation techniques - or at least ones that are easier to maintain!

Categories: Development, Software, C#