更新:2007 年 11 月
针对类型不是 XElement、XDocument 或 IEnumerable(Of XElement) 的对象引用了 XML 子元素。有关更多信息,请参见 XML 子轴属性。
' Generates an error.
Dim var = "sample text".<child>
**错误 ID:**BC36807
更正此错误
确保将要引用其属性的对象强类型化为 XElement、XDocument 或 IEnumerable(Of XElement)。下面是一个示例:
Dim elem As XElement = <root> <child /> </root> Dim var = elem.<child>