Search code examples
c#visual-studiodocumentation

Why can't I see my <example>s and <code>s from Intellisense? using C# and Visual Studio 2017-2019


I am currently using Visual Studio 2019 to write a WPF/C# application. After writing a new method I decided to add some examples for better usage. But my example won't show up in the Intellisense popup.

I've tried the following code:

        /// <summary>...</summary>
        /// <param name="path">...</param>
        /// <param name="action">...</param>
        /// <example>
        /// Use this method like this:
        /// <code>
        /// MyMethod("C:\\someFile.txt", s => File.Copy(s, "C:\\someFile (copy).txt"));
        /// </code>
        /// </example>
        public static void MyMethod(string path, Action<string> action)
        {
            // some code ...
        }

I expected my example to show up on the Intellisense popup that pops up when calling from another file. What happens is just the summary shows up without my examples..


Solution

  • It is simple - because it works so. And never worked as you expected.

    Your XML comments is fine but Visual Studio shows only <summary> section (Short discription of class \ method or property) for quick familiarize with class \ method or property you are going to use.

    XML comments can be very big, litterally nothing limits it size. Imagine what size shoud be tooltip to show you big comments?

    So if you or other developer use Visual Studio and tooltip with <summary> does not give you enough information - just simply go to decloration with F12 and read full comment OR you can show declaration right in current section with ALT + F12

    Not shure but i think it can be some extensions for showing tooltip as you want