0

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

问题是,当用户开始搜索信息(这是一个 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 7 上的 .NET 4.0 和 IIS 7。

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

4

1 回答 1

0

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

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

于 2012-11-13T12:43:02.773 回答