asp.net - 错误 : the details of the application error from being viewed remotely

标签 asp.net sql web-config connection-string

我有 2 个登录页面:Login.aspx-用于客户登录和 xlogin.aspx 用于管理员登录
我刚刚将我的项目上传到服务器,所有应用程序页面都运行良好
但是当我登录 admin xlogin.aspx 时,我被转发到 admin.aspx 页面 - 但我收到此错误:

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

这是我的 web.config
<?xml version="1.0"?>

<configuration>
  <connectionStrings>
    <clear/>
    <add name="PROJEntities" connectionString="metadata=res://*/PROJModel.csdl|res://*/PROJModel.ssdl|res://*/PROJModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=000.000.0.00;Initial Catalog=DBNAME;User ID=MYUSERNAME;Password=MYPASS;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />

    <authentication mode="Forms">
        <forms loginUrl="~/Login.aspx" timeout="720" slidingExpiration="true" defaultUrl="~/Gateway.ashx"/>
    </authentication>

    <customErrors mode="Off"/>
    <pages enableEventValidation="false" viewStateEncryptionMode="Never"></pages>
  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

  <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization>
          <converters>
            <add type="PROJ.Presentation.Common.DateTimeConverter" name="DateTimeJavaScriptConverter"/>
          </converters>
        </jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions>
</configuration>

最佳答案

亲爱的奥尔加很清楚消息的内容。关闭自定义错误以查看有关此错误的详细信息以进行修复,然后将它们关闭。所以添加 mode="off"为:

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

相对答案:
Deploying website: 500 - Internal server error

顺便说一句:错误消息声明 web.config 不是您在此处键入的那个。也许您忘记上传您的 web.config ?并记住关闭用于在线页面的 web.config 上的调试标志。

关于asp.net - 错误 : the details of the application error from being viewed remotely,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10783651/

相关文章:

css - 通过 css 悬停时的 ASP.Net 图像

sql - 错误的批量删除和更新——设计错误?

.htaccess - 将域重定向到另一个域,包括文件夹结构(如果可能,使用 SSL)

c# - 无法读取配置部分 'assemblies',因为它缺少部分声明

asp.net - 将 Sharepoint 数据复制到 SQL Server,然后使用该数据进行报告

c# - 是什么让 WCF 测试客户端出现在 WCF > WCF 服务应用程序而不是 ASP.NET Web 应用程序项目中?

c# - 如何在自定义 HtmlHelper 中使用 Html.TextAreaFor() 方法?

mysql - 为什么我不能添加这个外键约束?

Mysql - 子查询有超过 1 行

iis-7 - 基于根 url 的 IIS URL 重写