我几乎可以肯定这将是一个非常简单的答案,但我似乎无法在任何地方找到它.我们都知道当你将鼠标悬停在某些东西(如字符串)上时会弹出一个小摘要(如果已启用).对于一个字符串,它说:
class System.String
Represents text as a series of Unicode characters.
当我将鼠标悬停在其中一个课程上时,它只是说:
class Namespace.Widget
我已经尝试了我发现的两个明显的例子:
/// <summary> /// This summary does not work,I know it's for html documenting tools but thought it was worth a shot. /// </summary>
和:
// Summary: // This is what is in some of the base libraries,and does not work as well.
解决方法
我不明白为什么你的第一次尝试不起作用.这是< summary>评论标签提供您正在谈论的’工具提示’…
/// <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(); } }