Question

I have the following code:

using System.Xml;
namespace MyApp {
  public class Foo : IBar {
    public void SomeCallback(object sender, CallbackEventArgs e) {
      string s = e.Result;
      System.Xml.XmlDocument xml;  // <-- Error CS0234.
      ...

This results in error CS0234: The type or namespace name 'XmlDocument' does not exist in the namespace 'System.Xml' (are you missing an assembly reference?)

I have verified that System.Xml is included under "References" in Solution Explorer. It's listed as using 2.0.x.x, but that should be fine since the class allegedly existed then?

I'm not well versed in .net development, so I'm not sure how to troubleshoot this.

Was it helpful?

Solution

Based on the comment you posted to your question it looks like you are building a Silverlight application. The type XmlDocument is not included in the Silverlight version of the framework. The recommended alternative is XDocument

Here is a tutorial page on using XML in a Silverlight application

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top