views:

127

answers:

4

I'm almost certain this is going to be a very simple answer but I can't seem to find it anywhere. We all know when you hover your mouse over something (like a string) a little summary pops up (if its enabled). For a string, it says:

class System.String

Represents text as a series of Unicode characters.

When I mouse over one of my classes, it simply says:

class Namespace.Widget

I've tried the two obvious examples I've found:

/// <summary>
/// This summary does not work, I know it's for html documenting tools but thought it was worth a shot.
/// </summary>

and:

// Summary:
//     This is what is in some of the base libraries, and does not work as well.

So, how do I add a summary to the mouse-over pop-up??

A: 

Reset your settings in visual studio, they seem to be messed up. And for it to show up, you'd have to use the first example.

Malfist
I also have not installed the hotfix for the ctrl-f crash bug for fear of it messing up other things on my computer. Could this be linked to that?
Steve H.
I would doubt it.
Malfist
+2  A: 

I don't see why your first attempt wouldn't work. It's the <summary> comment tag which supplies the 'tooltip' you're talking about...

/// <summary>
/// This text should automatically show up as the summary when hovering over
/// an instance of this class in VS
/// </summary>
public class MyClass
{
    public MyClass() {}      
}

public class MyClass2
{
    public MyClass()
    {
        //hovering over 'something' below in VS should provide the summary tooltip...
        MyClass something = new MyClass();
    }
}

If you want help automating some of your commenting, try the free GhostDoc. By far one of the best free VS addons..

KP
A: 

The three-slash XML comments may be used to create the IDE tool-tips in Visual Studio. In particular, "summary" and "exception" work very well. (Other things like "code" have not worked in the versions of Visual Studio that I have used.)

If this is not working for you, then something may be wrong with your settings.

Jeffrey L Whitledge
<exception> doesn't work, but got <summary>. Oh well, this was cosmetic and peripheral anyway.
Steve H.
If the `cref` attribute of the `exception` element is set, then the exception will be listed in the tool-tip. Sadly, the element content is ignored. So let's say that it half works. :-)
Jeffrey L Whitledge
A: 

You need to use your first syntax, and, if you're using the class outside of your Visual Studio solution, you need to check Generate XML Documentation file in Project Properties.

SLaks