VB.NET XPathDocument.CreateNavigator throws “debuggerDisplayProxy” error

余生长醉 提交于 2019-12-11 10:26:42

问题


I'm new to this and working from a tutorial. I have a variation on the following code:

Dim xDoc As XPathDocument
Dim xNav As XPathNavigator

xDoc = New XPathDocument("xxxxxxx.xml")
xNav = xDoc.CreateNavigator()

However, "CreateNavigator" returns: 'debuggerDisplayProxy' is a type and cannot be used as an expression.

I've Googled and searched and found nothing (although I'm not really sure what to look for). This seems like something basic and it's stopping me from continuing with a lot of other stuff that I know works!


回答1:


It is not a real error, the debugger has a problem with the attribute on the class:

<DebuggerDisplay("{debuggerDisplayProxy}")> _
Public MustInherit Class XPathNavigator
    '' etc..
End Class

The name is spelled wrong, it should be "DebuggerDisplayProxy" with a capital D. For some reason this only goes wrong in VB.NET, this isn't a problem in C# so that's probably why it hasn't been fixed yet. Just keep clicking on the [+] to see the internal members of the object. And keep going, there's nothing wrong with your code.

I filed this as a bug report at Connect.



来源:https://stackoverflow.com/questions/10523900/vb-net-xpathdocument-createnavigator-throws-debuggerdisplayproxy-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!