I want to downgrade a Windows Mobile application made from .Net Compact Framework 3.5 to .Net Compact Framework 2.0 SP2 .
But ... I do not know how to make this piece of code compatible with version 2.0.
XDocument doc = XDocument.Load(string.Format(Open_Cell_Id_Uri, new object[]{
Settings.OpenCellIDApiKey,
towerDetails.MobileCountryCode,
towerDetails.MobileNetworkCode,
towerDetails.TowerId,
towerDetails.LocationAreaCode
}));
using (System.Xml.XmlReader reader = doc.CreateReader())
{
...
}
I changed the use of System.Xml.Linq using System.Xml, but this line complains:
using (System.Xml.XmlReader reader = doc.CreateReader())
How can I get an XmlReader from an XmlDocument?
This is the code I downgraded:
XmlDocument doc = new XmlDocument();
doc.Load(string.Format(Open_Cell_Id_Uri, new object[]{
Settings.OpenCellIDApiKey,
towerDetails.MobileCountryCode,
towerDetails.MobileNetworkCode,
towerDetails.TowerId,
towerDetails.LocationAreaCode
}));
using (System.Xml.XmlReader reader = doc.CreateReader())
{
...
}
Thanks!
source
share