c# - '/' Application.Runtime 错误中的服务器错误

标签 c#

<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/

相关文章:

c# - 如何使用 Task<T> 引发事件并等待事件完成

C# 在 List<T> Count 上等待

c# - NHibernate <一对多>

c# - 为什么所有下拉列表的 SelectedIndexChanged 事件仅在单击按钮后触发?

c# - 如何解决 : System. TypeLoadException?

c# - 如何使用 lambda 或 linq 订购 asc/dsc

c# - 从后面的代码更改 HTML 元素的样式属性

c# - 无法加载文件或程序集 'System.Windows.Interactivity'

c# - winforms .net c# - 外部程序

c# - newtonsoft.json 库错误