title: Why does XmlNode to XmlElement works in VB
body: <p>This is something I noticed looking at while working with some of our old vb code.
  This line will not throw any kind of cast exception...</p>
  
  <pre><code>Dim moduleElement As XmlElement = xmldoc.SelectSingleNode("/modules/module")
  </code></pre>
  
  <p>But this line will in C#...</p>
  
  <pre><code>XmlElement focusFieldsNode =  moduleNode.SelectSingleNode("ui/initial_focus_fields");
  </code></pre>
  
  <p>Now to resolve this I cast as an XmlElement, but why would that work in vb and not in C#?</p>