Intellisense can's see XML comments when 2-dimensional array is present

I ran into a problem with Intellisense not seeing the XML comments on some (but not all) of my methods. It appears that this happens whenever a 2-dimensional array is in the argument list. For example, if I compile the code below into a DLL, then call that method in another solution, Intellisense doesn't show my XML comments. However, another method in that class does the same thing except that it takes a 1-dimensional array, and Intellisense shows its comments OK. (I had to leave the latter method out because the forum editor kept deletng a big chunk of my message, possibly because the code snippet was too big.)

The code itself works fine -- it's just that Intellisense fails to show some of my XML comments.

Looking at the XML generated by the compiler, I noticed that it contains this:
<member name="M:XmlTest1.PrintArray.PrintArray1(System.Int32[])">
for the 1-dimensional method. On the other hand, for the troublesome method that takes a 2-dimensional array, the XML says:
<member name="M:XmlTest1.PrintArray.PrintArray2(System.Int32[0:,0:])">

The difference is (System.Int32[]) vs. (System.Int32[0:,0:]). I thought that maybe the 0: stuff was to blame, so I edited the XML manually to change [0:,0:] to [,]. That cured the Intellisense problem! So is this a bug, or is something wrong with my source code?

I can live with the fix I discovered, as long as there are no side effects waiting to bite me.

Code Snippet

namespace XmlTest1
{
/// <summary>
/// Class to investigate XML comments problem.
/// </summary>
public static class PrintArray
{
/// <summary>
/// Print first element of a 2-dimensional array.
/// </summary>
/// <param name="a">array</param>
public static void PrintArray2(int[,] a)
{
Console.WriteLine(a[0, 0]);
}
}
}


[2096 byte] By [PaulHirose] at [2008-1-10]
# 1
I seem to get the detail from Intellisense with methods like that. Could you provide more detail?
PeterRitchie at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# IDE...
# 2
One thing I may have failed to make clear -- Intellisense *does* work fine within the same Solution. I.e., if another Project within that Solution uses my example class, Intellisense sees the XML comments. But if you create a new Solution, adding the example DLL to the References, then it's as if there are no XML comments for the DLL.

So, to recap, build the code in my original post as a .NET Framework DLL, e.g. XmlTest1.dll. Close out that Solution, and create a new one, say, XmlTest2:

Code Snippet

namespace XmlTest2
{
class Program
{
static void Main(string[] args)
{
int[,] a2 = new int[,] { { 11, 12 }, { 21, 22 } };
XmlTest1.PrintArray.PrintArray2(a2);
}
}
}



Note that when typing in the call to PrintArray (or hovering the cursor over it), Intellisense doesn't show any of the XML comments. The program runs OK, though.

By the way, I'm using .NET Framework 2.0.

PaulHirose at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# IDE...
# 3

Hi Paul,

As a matter of fact, the xml comment are not metadata; they are not included in the compiled assembly and therefore they are not accessible through reflection as well as IDE intellisense.

So, when the user import an external assembly to the solution, the xml comment is certainly excluded (VS IDE intellisense know nothing about it).

In order to get full information about a type or member, the documentation file must be used in conjunction with reflection on the actual type or member. (about how to generate xml document file see: /doc (Process Documentation Comments) (C# Compiler Options)).

Check these document for your information: http://msdn2.microsoft.com/en-us/library/b2s063f7(VS.80).aspx(XML Documentation Comments)

How to: Use the XML Documentation Features

Thanks

FigoFei-MSFT at 2007-10-3 > top of Msdn Tech,Visual C#,Visual C# IDE...