外部注释以相反的顺序包含,.Net Visual Studio
预计到达时间:Visual Studio 2010 VB Express 版本表现出相同的行为。
预计到达时间:Visual Studio 2010 C# Express 版本不会表现出相同的行为。
在 VisualStudio 2008 VB Express 版本中,我指定了以下注释:
''' <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
如果我编译该文件并检查 .xml,我会发现注释的包含顺序与我指定的顺序相反。第 3 部分出现在第 2 部分之前,第 1 部分出现在第 1 部分之前。
有谁知道为什么会发生这种情况?
ETA:
附加行为:如果内联注释散布在外部包含之间,则它们都会首先写入 xml,然后写入包含(以相反的顺序)!
请设置一个名为“关闭不直观的 xml 注释行为”的选项
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'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我重现,此错误似乎特定于
部分。您可以发布到 connect.microsoft.com,但他们解决此问题的可能性几乎为零。因为修复它会破坏很多现有的项目。这也是解决方法的关键,长时间未修复的错误会变成“功能”。只要颠倒顺序即可。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.