May 5, 2008

The SlashDocs C# XML Comment Add In Updated for Visual Studio 2008

Summary: The SlashDocs addin for Visual Studio was updated to support Visual Studio 2005 and Visual Studio 2008. Go to the bottom to download the latest version.




One of the most useful features introduced with C# and Visual Studio.NET was the embedded XML Documentation Comments feature. Although exactly the same in concept as Java's venerable "JavaDoc" feature C#'s more structured and intuitive XML-based syntax, ability to deploy the standardized "compiled" XML output files, stellar IDE support, and compiler-enforced checking made it a nice evolution of what Java started with JavaDoc.



Few know that there is a way to write the compiler-verified C# XML Documentation Comments could be written in a separate XML file and still linked to the source code with the <include...> element. While not useful in many cases (i.e. when only the programmer writes and edits documentation), for a commercial team like ours at Data Dynamics we produce full production quality class library reference documentation using expert Technical Writers from our User Education (aka UE) team. In the early days of working on ActiveReports for .NET we lightly used these comments to enable the developers to write the class library documentation. Then the UE Technical Writers edited it (fixed spelling, and grammar, added more details, i.e. made it readable :) ). However, we quickly discovered neither the programmers nor UE wanted UE to edit the source code files. As much as you tell everyone "calm down, its just comments, it's okay for them to edit it; trust each other, etc." everyone was still uncomfortable, and what it eventually turned into is developers writing a "first draft" which was quickly abandoned while Technical Writers just started editing their own copy. This left the docs unchecked by the C# compiler and updates from the developers were not pushed back to UE so transparently. What a loss!



So when we started working on Data Dynamics Reports, I was a big advocate of using the <include...> element to enable writing the documentation in separate files from the source. This way dev's could check it and UE could edit it in separate directories from the source code itself. The immediate problem was that there was no IDE support for writing the documentation comments or even to generate the include links. So, like any geek would do, I added it. Back when VS 2003 was cool - I wrote a Visual Studio addin to aid in moving and linking these separate documentation files to the source. You can read more about it and see some screenshots in my original announcement of the project at the following location: http://blogs.pingpoet.com/overflow/archive/2005/11/29/15568.aspx.
Once I made a couple hacks to get it working in VS2005 but didn't publish it. Now I changed the add-in model completely to the new one introduced in Visual Studio 2005 and made it work in Visual Studio 2005 and Visual Studio 2008. I fixed a couple bugs people reported, but didn't add any new features other than support for VS2005/2008.






Get the latest version by clicking here!

14 comments:

Alessandro Petrozzelli said...

Hy Scott,
could you please verify the download link because it's not working.

scott said...

We had a hardware failure. Things are back up now. Thanks for your interest and let me know what you think!

alessandro petrozzelli said...

Thank you Scott but it's still not working for me. It's seems that the web server is serving the file with the wrong MIME type or something like that because the browser render the content as plain text. I also tried to "Save target as..." unsuccessful.

scott said...

I just tried it again here and it worked fine. I just clicked the link in Firefox and it saved okay. If you want send me an email and I'll email it to you. Just send a message to me at scott at willeke com.

M. Sarigiannidis said...

Hi, I have VS2008, but when I try to install I get the message "Visual Studio 2005, Visual Studio 2008 or both must be installed." Any ideas?

by the way, the server does return the wrong MIME for this file, but it's still possible to download it.

scott said...

I'll take a closer look and figure something out in the next day or two...

Andy said...

Like M. Sarigiannidis I too am getting the Visual Studio 2005/2008 error. On top of VS2008 I have the VS 2008 SDK, ReSharper 4.0, VisualSVN, DocProject and TestDriven.NET installed.

scott said...

@sarigiannidis & andy:
I found a stilly problem in my installer and I believe I've fixed it.
"ISVS2005INSTALLED OR ISVS2008INSTALLED" is probably a better launch condition than "ISVS2005INSTALLED OR ISVS2005INSTALLED" huh?

I've updated the "here" link above to the fixed installer. Unfortunately, I don't have a VS2008 only machine to test with. Can you give the updated link above a try and let me know if it is fixed please.

Also, don't forget when you're in a pinch and Windows Installer File holds you hostage you can grab lessmsi (http://blog.scott.willeke.com/2008/03/less-msirables-lessmsi-is-available.html) and just extract the files from the .msi file yourself :)

Andy said...

Thanks Scott, all works perfectly, good job. We have all made the copy/paste/(forget to)edit mistake before I am quite sure ;)

Pilot34 said...

Thank you! Very helpful, but i have some problems with generic classes and methods. Comments in xml-file are creating, but aren't deleted from c# source. Have you plan to support generics?

Pilot34 said...

ps problem is not with every generics. Only in complicated cases like

bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item)

scott said...

Hi Pilot34. I am planning to make some fixes soon and publish the whole project in a good opensource repository soon. It might be a few weeks as I have some business travel coming up, but I will do it.

Pilot34 said...

It would be great! We look forward to, because as I can find there is no another such decision.

qqq said...

To buy Lida daidaihua online.discount lida daidaihua slimming on sale~! cheap lida daidaihua slimming capsules for sale~!