. NET development Programmer Prerequisites-NDoc: Creating a Code documentation tool

Source: Internet
Author: User
Tags documentation

Writing code documentation is almost always a daunting task. I'm not talking about early design documents, not even more detailed design documents; I'm talking about the methods and properties on the record class. The NDoc tool can use reflection to parse an assembly and automatically generate documentation for code using XML generated from C # XML annotations. XML annotations apply only to C #, but there is a visual Studio. NET power Toy named Vbcommenter that can do similar work for visual Basic. Net. In addition, the next version of Visual Studio will support XML annotations for more languages.

When you use NDoc, you're still writing technical documentation for your code, but you're writing the code to do the work (in XML annotations), which is easier to endure. When using NDoc, the first step is to open the XML annotation generation feature for your assembly. Right-click the item and select Properties | Configuration Properties | Build, and then in the XML documentation file option, enter the path to save the XML file. When the project is built, an XML file is created that contains all the XML annotations. The following is a way to write a document in XML in the NUnit example:



///   <summary>
/// This is test adds a number of values to the Hashtable collection
/// And then retrieves those values and checks if they match.
///   </summary>
[Test]
Public   void Hashtableaddtest ()
{
// method is here
}


The XML document data about the method is extracted and saved in an XML file, as follows:



< Member name = " m:nunitexample.hashtabletest.hashtableaddtest " >
< Summary > <

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.