XML Value out of Range exception C# Windows Phone

7331

New Member
I have an error message when I try to run this code. If the XML file is small than this code works perfectly but when I load my real XML file which is 5MB it spits out an exception. The exception says: Value does not fall within the expected range. Here is my code and the exception highlights these lines out of the code x.Descendants("verse") .ToDictionary(y => y.Attribute("number").Value, y => y.Value)) //// Code\[code\]XDocument xDoc = XDocument.Load("file.xml");var books = xDoc.Descendants("book").Select(b => new { Name = b.Attribute("name").Value, Chapter = b.Descendants("chapter").ToDictionary( x => x.Attribute("number").Value, x => x.Descendants("verse").ToDictionary( y => y.Attribute("number").Value, y => y.Value)) }).ToArray();\[/code\]Please help. This is for Windows Phone. My app is working perfectly just cant get the larger XML file to work. Thanks.
 
Back
Top