3

ETA: Visual Studio 2010 VB Express edition exhibits the same behaviour.
ETA: Visual Studio 2010 C# Express edition does NOT exhibit the same behaviour.

In VisualStudio 2008 VB Express edition, I specify the following comments:

''' <summary>
''' ...
''' </summary>
''' <remarks>
''' <include file="Comments.xml" path="Section[@name='Part1']/*" />
''' <include file="Comments.xml" path="Section[@name='Part2']/*" />
''' <include file="Comments.xml" path="Section[@name='Part3']/*" />
''' </remarks>
Public Class MyClass

If I compile the file and examine the .xml, I see that the comments are being included in the reverse order to what I specify ie. Part3 appears before Part2 appears before Part1.

Does anyone know why this is happening?

ETA:

Additional behaviour: If inline comments are interspersed between the external includes, they are all written to the xml first and then the includes (in reverse order)!

Please let there be an option called 'Turn off unintuitive xml comment behaviour'

Jules
  • 4,319
  • 3
  • 44
  • 72

1 Answers1

2

I repro, this bug appears specific to the <remarks> section. You could post to connect.microsoft.com but the odds that they'll fix this are about zilch. Because fixing it would break a lot of existing projects. Which is also the key to the workaround, bugs that go unfixed for too long turn into 'features'. Just reverse the order.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • I had the same thoughts after posting to connect. They must have been aware of this before the 2010 edition but kept the behaviour. What they could do is have a solution or project setting in visual studio that one turns on to switch to expected behaviour - this way older project docs won't break. – Jules Sep 10 '11 at 13:22