2012-11-13 69 views
0

我在IIS 7上部署了我的網站,編譯它時沒有錯誤,但是當在遠程IIS 7上部署應用程序時,檢查頁面索引頁是好的,但錯誤消息顯示在下面的頁面。SocketException(0x274c)通過ASP.net,.net 4.0,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設置的問題,但直到現在我無法修復它。我的服務器環境是.NET 4.0和IIS 7,在Windows 7上。

我不知道如何跟蹤這個錯誤,如果有更多的信息或代碼需要提供,請提醒我,謝謝你的回答。

回答

0

通過堆棧跟蹤的外觀,您將URL傳遞給XmlDocument.Load函數。如果文件位於本地服務器上並且正在執行的應用程序池可以訪問該文件夾,請嘗試使用Server.MapPathdocs)來獲取文件系統位置,並將其傳遞到XmlDocument.Load

如果傳遞URL是所需的行爲,請檢查應用程序是否可以實際訪問外部資源(服務器上的代理設置等)。

+0

是的,問題來自XML加載,導致XML在本地主機上,並且我最終使用流I/O來加載它。 – shesee