Article Options
Recently Viewed
Premium Sponsor
Premium Sponsor

 »  Home  »  .NET Framework  »  XML Documentation and IntelliSence for Class Libraries in VB.NET
 »  Home  »  Data Programming  »  XML  »  XML Documentation and IntelliSence for Class Libraries in VB.NET
XML Documentation and IntelliSence for Class Libraries in VB.NET
by Paul Nichols | Published  02/21/2003 | .NET Framework XML | Rating:
Paul Nichols

Based in the UK I've been an IT contractor for over 5 years specialising in VB.NET and C# both on both Windows and Web based projects. Please feel free to contact me at mail@pandesolutions.co.uk or see my online CV at www.pandesolutions.co.uk

View all articles by Paul Nichols...

XML Documentation and IntelliSence for Class Libraries in VB.NET

As a VB developer one thing that I've been wondering how to achieve is providing my assemblies with a more professional look by adding summaries, descriptions, help and remarks to the classes, members and parameters. This help is often seen when using commercial assemblies both in the Object Browser and programmatically as you hover over a member shown in your IntelliSence list. Very regularly we must all think, OK what exactly does this parameter mean and even more importantly what does the method actually do!

The way these comments are associated with your class libraries is all through the creation of XML documentation files, which are located and shipped, in the same directory as the assembly.

When I first looked at C#, a nice feature I felt was the XML comments you can use to describe your code. You can then take these comments to build HTML documentation of your code. Strangely this isn't a feature of VB.NET?

At first I hadn't realised that upon compilation you can choose to have Visual Studio take these comments and create the XML documentation file and this is actually what gives you the extra help through IntelliSence. When I did realise this I searched around to find how the same functionality could be achieved for VB programmers.

The first useful link I came across was a Microsoft sample http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vbcs_XMLComments.asp. The Microsoft XML tool allows us to point to a compiled assembly and then the left side of the main screen shows, through reflection, the structure of the chosen assembly. The right side of the screen allows several types of comments to be included along with explanations. These are then saved to the XML file with the same name as the assembly (the file name has to be the same). The file can be maintained too at a later date.

The only draw back with this very useful free code is that it works with a complied assembly and doesn't actually attempt to add the comments to source code.What would be nice is to encourage programmers to comment our code, at the same time as those comments leading to XML documentation. This is where the next tool comes in. http://vbxmldoc.tor-erik.net/news.shtmlI believe it's still in Beta 2 at the moment but this program works as an add-in to Visual Studio and allows comments to be added simply as you would in C# but using ''' rather than /// to mark the comment. Then upon compilation, if you choose, the XML document can be produced.

I'm sure there are many more tools out there (for example another XMLDoc program http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=VBXMLDoc). But I'm sure that with the use of these two tools documentation and giving your assemblies the professional look should be a breeze.

How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Article Rating
The average rating is: No-one else has rated this article yet.

Article rating:3.77142857142855 out of 5
 35 people have rated this page
Article Score22868
Comments    Submit Comment

Comment #1  (Posted by Lorenz Schallinger on 03/12/2003)

There are currently two professional solutions for the the missing XML doc possibility of VB.NET :

We're using VBXMLDoc and it's a really sophisticated piece of software. It allows much more control of the XML doc generation process than the VS.NET-built-in support for C# does. It also offers a very good support for speeding up your documentation : If you type in ''' + in the line above the element you want to document (e.g. a class or a member function), VBXMLDoc auto-generates a skeleton for the XML comments. It even uses the component-designer attributes (e. g. "") if a property has already been marked with these attributes.
Together with NDoc it's the best tool for inline-documenting your VB.NET code currently available (http://vbxc.tor-erik.net/).

I also avaluated the Fesersoft VB.Net Xml Comments Creator (www.fesersoft.com). But this one has one *big* drawback : It doesn't use the ''' - comment style (like /// in C#). Instead, it uses attributes. So you will have to write a lot of extra-code when doing documentation - and it's not consistent with the way you document you C# code (sorry, Fesersoft). But it's very stable and well-documented.

VBXMLDoc is currently from my point of view the better product - but lets see, how much money it will cost if it's available as 1.0.


 
Comment #2  (Posted by Markus Palme on 03/12/2003)

Why is VB.DOC not mentioned ?

http://vb-doc.sf.net

Markus
 
Comment #3  (Posted by an unknown user on 01/03/2005)
Rating
Thanx for the information
 
Comment #4  (Posted by an unknown user on 01/13/2005)
Rating
Thanks for thisinfo... I'm developing a new system and it HAS to be VERY professional...

 
Comment #5  (Posted by an unknown user on 07/13/2005)
Rating
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vbcs_XMLComments.asp.

is a dead link
 
Comment #6  (Posted by an unknown user on 10/13/2005)
Rating
Because i just want to know the full kowledge about the IntelliSence for Class Libraries in VB.NET
 
Comment #7  (Posted by an unknown user on 07/18/2006)
Rating
Links are broken

 
Comment #8  (Posted by an unknown user on 09/19/2007)
Rating
Links are broken
 
Comment #9  (Posted by an unknown user on 10/24/2009)
Rating
Very nice site!
 
Comment #10  (Posted by an unknown user on 11/01/2009)
Rating
Very nice site!
 
Comment #11  (Posted by an unknown user on 11/09/2009)
Rating
Very nice site!
 
Sponsored Links