What is the use of XML comments in C#

前端 未结 6 1891
没有蜡笔的小新
没有蜡笔的小新 2020-12-19 11:36

What is the use of XML comments in C# than signal line and multiple line comments.

i.Single line
Eg:
//This is a Single line comment

ii. Multiple line (/* *         


        
6条回答
  •  醉酒成梦
    2020-12-19 12:25

    The XML comments are used to build API documentation which is readable by external tools. IntelliSense also reads these, and uses the contents to show the docs for your code in the assistance tooltips as you type (and in the Documentation window).

    The compiler (optionally) extracts all those comments and puts them in a single standalone XML file next to your assembly; this can be parsed.

    The idea was to have something like JavaDoc. Unfortunately Microsoft has failed to provide a mainstream mature tool to do so.

提交回复
热议问题