Home All Groups Group Topic Archive Search About

Referncing generic in XML comments

Author
30 Oct 2007 10:04 AM
Paul S
Hi

A have a generic class - InfoCollection<T>

The code comment for my constructor is:
        /// <summary>
        /// Instantiates a new instances of the <see
cref="InfoCollection[T]"/> class.
        /// </summary>

I get a warning in the compilation saying that the comment has syntactically
incorrect cref attribute.

How can I write my comment correctly. ?

--
Thanks
Paul S

Author
30 Oct 2007 10:28 AM
Jon Skeet [C# MVP]
On Oct 30, 10:04 am, Paul S <p...@community.nospam> wrote:
> A have a generic class - InfoCollection<T>
>
> The code comment for my constructor is:
>         /// <summary>
>         /// Instantiates a new instances of the <see
> cref="InfoCollection[T]"/> class.
>         /// </summary>
>
> I get a warning in the compilation saying that the comment has syntactically
> incorrect cref attribute.
>
> How can I write my comment correctly. ?

Use braces instead of square brackets:

<see cref="InfoCollection{T}" />

(Intellisense may help if you hit Ctrl-Space after typing InfoCol - or
that could just be ReSharper on my box.)

Jon

AddThis Social Bookmark Button