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

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top