How do you document members of members in C# XML-Comments with the <see cref=".."
tag?
I'm trying to document them the same way as type members, but it's giving me the warning "XML comment has cref attribute '...' that could not be resolved"
Here's the documentation comment in question:
/// <exception cref="ArgumentException">Thrown if <paramref name="namelistInstance"/> is not an instance of <see cref="Parent.UnderlyingType"/></exception>
Where Parent
is a member of the class this comment is in, and UnderlyingType
is a member of Parent
.
A shortened version of the code:
public class Class1
{
public Class2 Parent;
/// <summary><see cref="Parent.UnderlyingType"/></summary>
public void Method() {}
}
public class Class2
{
public Type UnderlyingType;
}