How do I write a class so that property and method descriptions are visible to people referencing the dll in other projects?
[Description("My age in years attribute")]
public int Age
{
get { return 0; }
set { }
}
doesn't work, neither does
/// <summary>
/// My age in years attribute
/// </summary>
public int Age
{
get { return 0; }
set { }
}
In Visual Studio:
Project -> Properties -> Build -> Check "XML Documentation File".
For further details, see XML Comments Let You Build Documentation Directly From Your Visual Studio .NET Source Files.
The description provided in DescriptionAttribute
is visible in Property Grid for sure and it has nothing to do with code editor.
For XML comments to be available, you have to generate an XML documentation file and ship it with your assembly.
Did you build the XML documentation file
for your second case?
Project properties -> Build -> [Output] XML Documentation file
The second should work (summary), be sure to select in the project Properties (Build -> Output ) XML Documentation File.