我在IIS中部署的一个网站上收到此错误,当我从网络系统浏览时出现此错误。
其他网站工作正常
`Server Error in '/' Application.
No such host is known
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: No such host is known
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.
Stack Trace:
[SocketException (0x2af9): No such host is known]
System.Net.Dns.InternalGetHostByAddress(IPAddress address, Boolean includeIPv6) +3192148
System.Net.Dns.GetHostEntry(String hostNameOrAddress) +8777246
_Default.Page_Load(Object sender, EventArgs e) +320
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178`enter code here`
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18055'`
答案 0 :(得分:1)
当你在堆栈跟踪上看到的Dns.GetHostEntry以及你所拥有的明确消息时,你所拥有的是一个 unhanded exception 。
使用try / catch包裹这部分代码并在系统上记录错误。如果您知道dns名称至关重要,那么您需要显示错误页面并附上进一步说明。