When I am trying to parse a string value which has a huge text, then I am getting system out of memory exception.
I am using below code.
foreach (KeyValuePair
{
XElement node = (from c in orderXML.Descendants(item.Key) select c).FirstOrDefault();
if (!object.Equals(node, null))
{
XElement xmlValue = XElement.Parse(item.Value.ToString()); // Here I am getting system out of // memory Exception
node.ReplaceWith(xmlValue);
}
}

Ck NitinPosted Apr 22, 2014, 1:39 AM
http://social.msdn.microsoft.com/Forums/vstudio/en-US/5060b212-a2e3-4849-ad51-af1f20b74056/parsing-string-to-xelement-throwing-systemout-ofmemory-exception?forum=csharpgeneral&prof=required