Share hosting <customErrors mode=“Off”/> error

妖精的绣舞 提交于 2019-12-25 02:44:39

问题


I create very simple web form app in local. And I used sql connection at just couple page. It was working fine.

But I upload the site to share hosting I get this error.

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>

And my web.config file

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <location path="httpdocs">
    <appSettings>
      <add key="ConnectionString.SQL Server (SqlClient)" value="connection string"/>
    </appSettings>
    <system.web>
      <deployment retail="false"/>
      <httpRuntime targetFramework="4.0"/>
      <compilation targetFramework="4.0" debug="true"/>
      <anonymousIdentification enabled="true"/>
      <pages validateRequest="false" enableEventValidation="false" controlRenderingCompatibilityVersion="4.0"/>
      <customErrors mode="Off"/>
    </system.web>
  </location>

</configuration>

I get this error only try use sql connection page. For example my home page didnt use any sql connection and its working well.But About page get data from sql server, and its not working,give this error.

winglas.net/Hakkimizda.aspx

You can see error in that link.

Thanks guys !

来源:https://stackoverflow.com/questions/22301964/share-hosting-customerrors-mode-off-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!