错误:远程查看应用程序错误的详细信息

问题描述 投票:9回答:4

我有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>
asp.net sql web-config connection-string
4个回答
16
投票

亲爱的奥尔加清楚地说明了这个消息。关闭自定义错误以查看有关此错误的详细信息以进行修复,然后将其关闭。所以添加mode =“off”为:

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

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

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


1
投票

在我的情况下,我收到此消息,因为我的connectionstring中有一个特殊的char(&),删除它然后一切都很好。

干杯


0
投票

说明:服务器上发生应用程序错误。此应用程序的当前自定义错误设置可防止远程查看应用程序错误的详细信息(出于安全原因)。但是,它可以由运行在本地服务器计算机上的浏览器查看。

详细信息:要在远程计算机上查看此特定错误消息的详细信息,请在位于当前Web应用程序根目录中的“web.config”配置文件中创建标记。然后,此标记应将其“mode”属性设置为“Off”。


0
投票

即使在web.config文件中关闭自定义错误,这也可能是您收到的消息。这可能意味着您承载应用程序的驱动器上的可用空间不足。如果驱动器上没有其他空间,请清理日志文件。

© www.soinside.com 2019 - 2024. All rights reserved.