From: http://blog.csdn.net/zhoufoxcn/archive/2009/04/27/4127799.aspx
Generate a help document similar to msdn for your class library
. NET developers all know the well-known msdn help Article Microsoft defines the msdn help document for vs2008 as follows:
"Msdn library for Visual Studio 2008 is an authoritative developer document. We will continue to provide you with the latest help information about Visual Studio 2008 release, and we have also enhanced the help options, including online F1 topic, search, indexing, and online or offline directory usage. For more information about the library improvement feature, click the link on the right or visit the new feature page ."
Here is the msdn:
Have you ever thought of your Program A similar document is generated to facilitate other developers to read the API documentation of the class library you provide? Early developers may know the ndoc tool, which is similar to Javadoc and can Code To generate help documents.
What? What is XML annotation? See:
XML annotations can be seen when someone else writes code in vs to get the smart sensing effect, such:
Sometimes the program cannot be provided for some reason Source code In this way, you cannot easily view the classes and corresponding methods in the class library. Early. NET developers can use ndoc to generate API documents for class libraries, but ndoc does not. NET 2.0 (it is said that the author knows that Microsoft wants to release similar tools to stop updating), although there are some development support on the Internet based on ndoc.. NET 2.0, but sometimes some problems occur during use.
Microsoft has released a small software that supports this feature. It supports the generation of documents in CHM or HXS format. This software is sandcastle, which can be downloaded from http://download.codeplex.com/the website, which is:
Http://sandcastle.codeplex.com/Release/ProjectReleases.aspx? Releaseid = 13873 (if the English is not good, you can download it at http://download.csdn.net/zhoufoxcn)
After downloading the software from the Internet and installing it by default (assuming that the software is installed in the c: \ Program Files directory by default), examples \ genericunder the installation directory will see a file named sandcastlegui.exe, this file is sandcastle's graphical user interface. The interface of this software is very simple, as shown in:
Sandcastle generates help documents based on the program set and corresponding XML annotation documents. However, by default, the XML annotation document of the program is not generated. You need to configure it in vs. Right-click the project in which the help document is to be generated and select view attributes, in this way, the project property configuration page appears, and then click the "generate" tab, as shown in:
Select the XML document comment, so that the corresponding XML document comment will be generated each time the compilation is successful. By default, the comment is in the same directory as the generated Assembly file.
Run sandcastle and add comments to the Assembly and XML documents respectively. If the Assembly has dependent programs, add them and enter the name of the saved file, if there is no problem, the corresponding API documentation will be generated. If there is a problem, the error information will be displayed in the log window, as shown in.
The ns is successfully generated from the window. common. the CHM File Path is c: \ Program Files \ sandcastle \ examples \ ns. common \ vs2005 \ CHM \ ns. common. CHM, with a size of 126,213 bytes. Open the c: \ Program Files \ sandcastle \ examples \ ns. Common \ vs2005 \ CHM \ folder, and you can see a CHM File. Open this CHM file and you will see the following results:
Is this interface similar to msdn? So far, the success is achieved. By the way, this software is open source code. If a friend is interested in time and has good English skills, it would be better to convert it into Chinese, however, this tool is very easy to use, even if it is not in Chinese.
Note: sandcastle supports generating a CHM File by commenting on XML documents of multiple Assembly sets. You can place comments of multiple Assembly sets and corresponding XML documents in two folders respectively, then, use the addfolder function to add files in the folder to the project at a time, so that you can combine the XML comments of multiple assembly to generate a CHM document.
Zhou Gong
At
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/zhoufoxcn/archive/2009/04/27/4127799.aspx