3

I have used XML comment on a property which is a type of List.

However when I hover my mouse to that property, Visual Studio shows it as List<T>.

When I build the documentation with docFx, it still renders the comment as List<T> instead of List<ClassXXXX>.

I have tried the solution recommended by previous post here but it does not work.

Here is the XML comment with C# code for your reference:

/// <summary>
/// Gets and sets the <see cref="List{T}"/> .
/// </summary>
public List<ClassXXXX> ListFoo { get; set; }

What can I do in the XML comment so I can see List<ClassXXXX> in the intellisense and documentation?

Thanks

Unknown
  • 778
  • 1
  • 7
  • 16

1 Answers1

2

Set the text you want explicitly in the <see> tag:

/// Gets and sets the <see cref="List{T}">List&lt;ClassXXXX&gt;</see> .

You cannot specify List<ClassXXXX> directly in the cref attribute. The cref is a reference to a type definition and to its documentation. There's no type List<ClassXXXX> and no documentation for it. There's only List<T> to which you can create a link. But the link text may be anything you need.

Peter Macej
  • 4,831
  • 22
  • 49