Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show content inside see cref in XML comment from Intellisense and DocFx?

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

like image 506
Unknown Avatar asked Oct 24 '25 04:10

Unknown


1 Answers

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.

like image 80
Peter Macej Avatar answered Oct 25 '25 19:10

Peter Macej



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!