问题
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