<httpRuntime executionTimeout="600" maxRequestLength="11000"
requestLengthDiskThreshold="80"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="5000"
enableKernelOutputCache="true"
enableVersionHeader="true"
requireRootedSaveAsPath="true" enable="true"
shutdownTimeout="90" delayNotificationTimeout="5"
waitChangeNotification="0" maxWaitChangeNotification="0"
enableHeaderChecking="true" sendCacheControlHeader="true"
apartmentThreading="false"/>
<trust level="Full"/>
<customErrors mode="on" defaultRedirect="~/Contents/error.aspx">
</customErrors>
这是我在 web.config
中的错误处理,它不起作用。
如果抛出任何异常,它不会重定向到 /Contents/error.aspx
页面
是不是因为我设置了/Contents/error.aspx -
如果不是错误处理有什么问题。
最佳答案
您是否已将虚拟目录配置为适用于正确框架版本的 ASP.NET 应用程序?
This error can be caused by a virtual directory not being configured as an application in IIS.
在 IIS 中,您可以有多个应用程序,但必须将它们配置为一个应用程序。通常,当您创建 Web 项目时,它会直接映射到 IIS 应用程序。
请咨询您的托管服务,了解如何为您的网络应用程序创建 IIS 应用程序。
参见 IIS Setup
看看here
关于c# - '/' Application.Runtime 错误中的服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21695697/