The Sandcastle method generates a document that c#.net the Help class help document that is the CHM suffix, in fact the XML file generated by the C # documentation comment to generate the help document. So the first step is to generate an XML document,
Step 1 Generate an XML document
1, open vs-> feel free to create a project (here I use the console project), and then add a student class, that is, student information, as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using System.Threading.Tasks;
Namespace ConsoleApp
{
<summary>
Student Information
</summary>
public class Student
{
<summary>
Name
</summary>
public string Name {get; set;}
<summary>
Age
</summary>
public int Age {get; set;}
<summary>
Address
</summary>
public string Address {get; set;}
<summary>
Brief introduction
</summary>
<param name= "name" > Name </param>
<param name= "Age" > Ages </param>
<param name= "Address" > Addresses </param>
<returns></returns>
public string Intrduce (string name, string age,string address) {
Return ' My name is ' + name + ', Age: ' + age + ', Address: ' + address;
}
}
}
PS: Note that I am here the Student class's access modifier is public, because I only use a class here, if the non-public will appear "no APIs found to document. See error topic in Help file for details. " The error.
2. Right-click the Assembly Selection property and select the XML document file:
3. Save, compile, and then in the project's bin\debug directory you will see the generated XML file:
4, after the completion of the preparatory work, we can get a testprductchm.xml file, the following is to use Sandcastle Generate code Help document
Step 2 Sandcastle Build the Help documentation tool
1. Download Sandcastle Tools
Sandcastle is Microsoft's Official document generation tool, which seems to be the only tool in this area after NDoc development has stopped. It can generate complete help documents from DLL files and their XML comment files, supporting multiple generation formats (Helpe1x:chm, HELPER2X:HXS, Website,helperview), combined with the newly released sandcastle helps file Builder visualizer, the entire build process is very simple, and the SHFB tool looks very powerful, not only can directly configure the various properties of the generated document, but also support very flexible extension settings, to provide us with perfect. NET class Library document becomes a possibility.
Download the tool from here:
sandcastle:https://github.com/ewsoftware/shfb/releases, click shfbinstaller_v2018.7.8.0.zip.
Sandcastle Help File builder:http://shfb.codeplex.com/
I found a vs plugin in SHFB's compression package, so I'm going to use vs to demonstrate, if I don't want to install the plugin,
You can run C:\Program Files (x86) \ewsoftware\sandcastle help File Builder\sandcastlebuildergui.exe This program, the results are the same
2, install the Sandcastle tool, installed here is Shfbinstaller, click SandcastleInstaller.exe
3, always click Next, when the following interface appears, note, to install HTML help Workshop, otherwise there will be an error
(Shfb:error be0037:could not find the path the the the the HTML Help 1 compiler. See the error number topic in the "Help" file for details.),
Microsoft HTML Help is not installed, and of course you can skip this step after you install it. (Install Microsoft HTML Help https://docs.microsoft.com/zh-cn/previous-versions/windows/desktop/htmlhelp/ Microsoft-html-help-downloads)
The Sandcastle method generates the C#.net Help class help document CHM