Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
XML comment has cref attribute 'attribute' that refers to a type parameter.
This error is generated for an XML comment in case of using a <see> tag with cross reference (cref) to a type parameter instead of the existing type (whether user-defined or built-in) in the code. It's impossible to link to 'attribute' of generic types because at the moment of creating the documentation the future type given as 'attribute' is not yet known.
To solve this issue, use the <typeparamref> tag.
Example
The following example contains a comment generating CS1723 as well as a reference that can be linked correctly.
public class Point
{
}
// compile with: /t:library /doc:filename.XML
///<summary>A generic list class.</summary>
///uses <see cref="T" /> // CS1723
///and <see cref="Point" /> // No warning
public class List<T, Point>
{
}
The next example shows how to correctly link both generic type T as well as already known user-defined Point.
public class Point
{
}
// compile with: /t:library /doc:filename.XML
///<summary>A generic list class.</summary>
///uses <typeparamref name="T" /> // No warning
///and <see cref="Point" /> // No warning
public class List<T, Point>
{
}