How to have comments in IntelliSense for function in Visual Studio?

后端 未结 12 1533
难免孤独
难免孤独 2020-12-04 10:42

In Visual Studio and C#, when using a built in function such as ToString(), IntelliSense shows a yellow box explaining what it does.

How can I ha

12条回答
  •  不思量自难忘°
    2020-12-04 11:03

    use /// to begin each line of the comment and have the comment contain the appropriate xml for the meta data reader.

    ///
    /// this method says hello
    ///
    public void SayHello();
    

    Although personally, I believe that these comments are usually misguided, unless you are developing classes where the code cannot be read by its consumers.

提交回复
热议问题