Search code examples
c#visual-studiocode-documentationhint

Visual Studio hint, while working with C# classes


In my C# program, I have the following source code:

if ((Int32.Parse(u_Message.PK1)

When hovering my mouse above the word Int32, this is what I see:

enter image description here

I'm especially interested in the phrase "Represents a 32-bit signed integer.", and it is caused by the following (decompiled) source code:

//
// Summary:
//     Represents a 32-bit signed integer.
[Serializable]
[ComVisible(true)]
[__DynamicallyInvokable]
public struct Int32 : 

However, when I try to get the same thing for my personal class, this seems not to work:

Piece of source code, defining the class:

    //
    // Summary:
    //     Coldstart message
    public class Message_Rec_A_Message : Message

When hovering over such a class:

enter image description here

As you see, there's no message "Coldstart message" in that hint.

How can I get it there?

For your information: I already have built my solution, that did not solve the issue.


Solution

  • What you are seeing for Int32 is generated / decompiled code, and it doesn't necessarily conform to how code documentation should be.

    For your own example, try the following:

    /// <summary>
    /// Coldstart message
    /// </summary>
    

    Note the number of comment slashes and the XML formatting.

    This is called XML Documentation, and you can learn more about this from Microsoft.