DOTNET project development document automatic generation and use of related tools

xiaoxiao2021-03-06  61

In VS.NET's IDE provides some XML comments that can be generated automatically, using these comments, using objects defined in the code, annotate, by setting the project properties, when generating items, allowing VS.NET automatic Outing these comment information into an XML file, these XML documents can be converted to an HTML file in the MSDN format with document automatic generation tool NDOC, and automatically compile into a CHM file.

For C # items, in the IDE of VS.NET, the XML annotation frame can be automatically generated by input "///" before class, method, attribute, etc., and fill in the content directly in the frame. For example, as follows:

A SAMPLE class is defined in the SampleNameSpace namespace, which has a SomeEvent event except the constructor, and the description of this class and event is as follows:

Using

System;

Namespace

Samplenamespace

{/ ** ////

/// Sample class summary explanation. /// /// Written by Remarks Lab Writing /// This is an example of example public class sample {/ ** //// /// Test ///// // Todo: Add Construction Function Logic //} / ** //// /// Summary of function / procedure /// /// Description of parameters StringParam /// Description of Parameters INTPARAM < / param> /// Description of the return value public boolean someevent (String StringParam, INT32 INTPARAM) {// / Function / Process // Return true;}}}}

All XML tags are automatically generated by the IDE in the comment content in "///" in the above code, and only the content is required.

In addition to the tabs used above, NDOC also supports other tags, see document comment tags supported by NDOC.

For VB.NET projects, IDE needs to install a third-party tool VBcommenter, support XML annotation automatically, and then automatically generate an XML annotation framework by entering "''" Enter after installation.

In the project generation process, the XML document containing the project XML annotation information is not generated by default. You need to configure the project: Open the project, select the menu "Item" → "XXXX Project Properties" → Configure Properties → "Build" → "XML document File, fill in the XML file name you want to output here.

The above configuration instructions apply to the C # item, the VB.NET project needs to install the VBCommenter and select the "Create .xml Files When Projects Are Built" option, VBComMENTER does not allow yourself to set the output XML file name, the output XML file name defaults to the project name ".xml". After doing the above configuration, you will automatically output the XML annotations fill in the source code to the specified file when you generate an item.

Once you have output to the XML file, you can use NDOC to generate a project development document.

NDOC is an open source project based on GPL protocol. The homepage http://sourceforge.net/Projects/ndoc/, the latest version is V1.3 Beta1a.

Run the ndocui.exe file Open NDOC, click on the menu "Project" → "New from Visual Studio Solution" to select a Visual Stucio solution and create a new NDoc project for it, then select the assembly you want to add to the project: Click " Add button Select an assembly file name and an XML annotation information document file name that should have an assembly file. Click OK to add to the project, repeat the above steps to add all the assembly to generate documents to the NDOC project.

The bottom of the window is the NDOC project property setting section, the use method and the property window of the Visual Studio.net, each attribute is briefly introduced below, you can set this information on the appearance, copyright information of the final generated CHM document. .

There are several options in the finalized document format, including five kinds of Javadoc, Latex, LineArhtml, MSDN, XML, we generally generate an HTML document in the MSDN format and compile them into a CHM file.

After the setting is complete, click the "Build Documentation" button to generate an HTML document and compile it to a CHM file.

The settings for the NDOC project can be saved as .ctoc configuration file, NDOC also provides a ndocconsole.exe file, using this file to complete the compilation of NDOC projects in the command line, which provides a simple in the continuous construction process Method to complete the automatic generation of documents.

Author: NetCobra reprint to: http: //www.cnblogs.com/NetCobra/archive/2004/09/07/40755.aspx

转载请注明原文地址:https://www.9cbs.com/read-119321.html

New Post(0)