I'm sure there's something blindingly obvious I'm missing here.
I have an ASP.NET MVC2 app with an XML doc at /content/mydoc.xml. I'm trying to load it using XmlTextReader:
XmlTextReader reader = new XmlTextReader("/content/mydoc.xml");
Stepping through, I can see that this is being resolved to file:///C:/content/mydoc.xml
I know I can use Server.MapPath()
to get the file path but that seems rather hackish given that the XML doc is available via http.
Is there a way to get XmlTextReader to properly resolve the URL?