In my opinion, there is nothing built in. You can get the XML content yourself using a WebRequest instance (which you can set a timeout for), and then pass the XML data directly to XDocument.Load .
Technically, the most βreliableβ solution would be to implement an XmlResolver that uses WebRequest in GetEntity () to timeout. Then create an XmlReader based on the XmlResolver and pass the XmlReader to XDocument.Open .
The reason I will say that it would be more "reliable" is because if the XML file refers to other objects on the web server (for example, DTD), you probably need a timeout for this, and not just initial request.
Dean harding
source share