ฉันมีรหัสต่อไปนี้ที่ดึงลิงก์ไปยังโพสต์ล่าสุดจากไซต์ย่อยของบล็อก:
XDocument doc = XDocument.Load("http://www.mysite.com/blog/syndication.axd");
XElement node = doc.Descendants("item").FirstOrDefault();
string text = node.Element("title").Value;
string uri = node.Element("link").Value;
รหัสทำงานได้ดีเสมอ สัปดาห์นี้ฉันได้เพิ่ม ELMAH.MVC ผ่าน NuGet เป็นข้อมูลอ้างอิงแพ็คเกจ ทันทีที่ฉันปรับใช้ไฟล์ web.config ด้วยส่วน ELMAH ที่เพิ่มเข้ามา ฉันได้รับข้อผิดพลาดต่อไปนี้:
System.Web.HttpException (0x80004005): Error executing child request for handler
'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.
---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
ถ้าฉันใส่ไฟล์ web.config เก่ากลับ ข้อผิดพลาดจะหายไป
มีความคิดใดบ้างว่าทำไมการเพิ่ม ELMAH จะทำให้ XDocument.Load ล้มเหลว