.Net 2.0 => XmlReader returns "{None}"

  • Thread starter Thread starter Franck
  • Start date Start date
F

Franck

Hi,
I'm quit confused with the following problem:
I'm tryin to read an Embedded Xml file from my Class Library using a
static method which should returns a XmlReader.

The point is that using DataSet or XmlDocument works perfectly... using
XmlReader always fails. I always get "None" as a result.

Even using XmlReaderSettings does not change anything.

*****
Assembly a = Assembly.GetExecutingAssembly();
Stream s = a.GetManifestResourceStream("MyFile.xml");
XmlReader rdr = XmlReader.Create(s);
*****

Any help would me most welcome.

Thks.
 
I am having the exact same problem. I have tried several examples from the
web, and Create always returns "{None}".

Here is my code:

XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Fragment;
settings.IgnoreWhitespace = true;
settings.IgnoreComments = true;
XmlReader reader = XmlReader.Create("C:\\BookParticipant.xml", settings);

The BookParticipant.xml file contains:
<BookParticipant
type="Author"><FirstName>Joe</FirstName><LastName>Rattz</LastName></BookParticipant>

One thing, I have the May LINQ CTP installed. I can't help but wonder if it
may be involved. Franck, do you have it installed?

Thanks.
 
Back
Top