SocketException(0x274c)通过ASP.net,.net 4.0,IIS 7

时间:2012-11-13 08:46:30

标签: asp.net .net iis-7 xml-parsing

我在IIS 7上部署了我的网站,在编译它时没有错误,但是当在远程IIS 7上部署应用程序以检查页面时,索引页面很好,但错误消息显示在以下页面。 / p>

问题是,当用户开始搜索信息(这是一个xml文件请求)时,该页面会显示一些错误,如:

Server Error in '/' Application.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.Sockets.SocketException:  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. xx.xx.xx.xx:xx

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

堆栈追踪:

[SocketException (0x274c):  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. xx.xx.xx.xx:xx]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +305
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +699

[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetResponse() +7863572
System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) +160
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +310
System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) +75
System.Threading.CompressedStack.runTryCode(Object userData) +136
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) +0
System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) +118
System.Xml.XmlTextReaderImpl.OpenUrl() +5030375
System.Xml.XmlTextReaderImpl.Read() +120
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +172
System.Xml.XmlDocument.Load(XmlReader reader) +144
System.Xml.XmlDocument.Load(String filename) +205
parkWebService.page2.GmarkersCreator() in c:\Users\61085\Documents\C_parksystem_Web\C_parksystem_Web\parkWebService\parkWebService\search_map.aspx.cs:87
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

我想知道它是否是IIS 7设置的问题,但到目前为止我无法修复它。我的服务器环境是Windows 4.0和IIS 7,在Windows 7上。

我不知道如何追踪此错误,如果需要提供更多信息或代码,请提醒我,并感谢您的回答。

1 个答案:

答案 0 :(得分:0)

通过堆栈跟踪的外观,您将URL传递给XmlDocument.Load函数。如果文件位于本地服务器上并且正在执行的应用程序池可以访问该文件夹,请尝试使用Server.MapPathdocs)获取文件系统位置并将其传递给{{1}而不是。

如果传递URL是所需行为,请检查应用程序是否可以实际访问外部资源(服务器上的代理设置等)。