Where do Visual Studio Intellisense comments come from? Where do Visual Studio Intellisense comments come from? xml xml

Where do Visual Studio Intellisense comments come from?


When the source code is within the existing solution (or even better, the same project), Visual Studio doesn't need to find an XML file - it knows where the documentation comments are, so it will use them. (Just like Intellisense knows what members you've declared in the other file, even if you haven't actually rebuilt yet.)

You need to create an XML file if you want to add a reference to a DLL rather than a project reference within the same solution. So for example, I supply NodaTime.xml with the Noda Time package, so that even though you don't have the source code, you can still see the comments in Intellisense.


Intellisense gets it from its XML comments.

For example, let's say I have a class:

///<summary>/// This is an example class///</summary>static class Foo{    //members}

In fact, you can go even deeper than that. For example, a method:

///<summary>///Returns the object to string, uppercased.///</summary>///<param name="o">The object to be transformed.</param>///<returns>The string.</returns>public string someMethod(object o){   return o.ToString().ToUpper();}