C# – API documentation for self-built SDK
C# – API documentation for self-built SDK What should you pay attention to when creating a .NET library yourself? I would like to share with you some tips on building your own library. In the construction of API documentation for this introductory issue, self-built SDKs must not ignore its API documentation. This will determine whether your SDK is robust and friendly. Add API documentation in code When users use class libraries, they usually need to view the annotations of the API through VS’s Intellisense or F12 decompilation, and use these annotations to understand how to use the API. In C# source files, you can document the API required by a class library in your code by writing special comment fields represented by triple slashes. The comment field contains XML elements that describe the code block below it. XML elements provide a structured format for the API document and are easy to parse by tools such as compilers. For example: /// /// Function does an important thing. /// /// The result. public string DoSomething {} Generate API document XML file The GenerateDocumentationFile property controls whether the compiler generates an XML documentation file for the library. By setting this property to true,…