Asp.net

error:遠端查看應用程序錯誤的詳細資訊

  • February 28, 2018

我有 2 個登錄頁面:Login.aspx-用於客戶登錄和 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="Data Source=000.000.0.00;Initial Catalog=DBNAME;User ID=MYUSERNAME;Password=MYPASS;MultipleActiveResultSets=True"" 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>

相對答案: 部署網站:500 - 內部伺服器錯誤

順便說一句:錯誤消息聲明 web.config 不是您在此處鍵入的那個。也許您忘記上傳您的 web.config ?並記住關閉用於線上頁面的 web.config 上的調試標誌。

引用自:https://stackoverflow.com/questions/10783651