ASP.NET - Deployment Issues - Enabling Stack Trace Log / Trace Tracking via Web.Config to Find the Cause of 500 Internal Server Error

I get an Internal Server 500 error after deploying an application that was compiled without errors on my local machine. The server on which the application is deployed has a ton of security, so I need to specify read and write access for each directory. This application uses Windows authentication and a web service to populate drop-down boxes through a proxy server. I think that there may be a problem connecting to the web service or a problem with read / write security in files or a problem with authentication of the active directory.

I edited web.config so that it displays more information about the cause of the error with the following code:

<system.web>
  <customErrors mode ="Off"></customErrors>
  <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
  <trace enabled="true" pageOutput="true" />

  <authentication mode="Windows"/>
   <authorization>
    <allow roles="alg\ADMIN_USER" />
    <deny users="*" />        
  </authorization> 

<client>
  <endpoint address="http://63.236.108.91/aCompService.svc" binding="basicHttpBinding"
    bindingConfiguration="BasicHttpBinding_IAcompService" contract="aComp_ServiceReference.IAcompService"
    name="BasicHttpBinding_IAcompService" />
</client>

Now I get the following error:

    500 - Internal server error.

    There is a problem with the resource you are looking for, and it cannot be 
    displayed. 

I would like to see a stack trace with the source of the error.

What should I put in the web.config file so that it displays the full stack trace?

What needs to be changed on the website from local launch to deployment?

Update. The deployment guy lifted the read and write security restrictions, and now I get

    Parser Error Message: The connection name 'ApplicationServices' was not found in 
    the applications configuration or the connection string is empty. 

To get rid of the error, I deleted the AspNetSqlRoleProvider declared on line 72 and the error is still received. Then I deleted AspNetWindowsTokenRoleProvider and all the information about the provider and received the following error:

    Exception message: Default Role Provider could not be found.  

, - -. , . :

    There is a problem with the resource you are looking for, and it cannot 
    be displayed.

?

, !

+3
3

web.config , ? , web.config , .

.

+1

, ? web.config :

  <authentication mode="Windows"/>
  <identity impersonate="true"/>

WriteToEventLog, .

    Catch Ex As Exception
        WriteToEventLog(Ex.Message, "GetCarriers-Method", EventLogEntryType.Error, "aComp-utility")


    Catch ex As Exception
        WriteToEventLog(ex.Message, "GetMarketingCompanies-Method", EventLogEntryType.Error, "aComp-utility")

, TraceListenerLog ?

MSDN . web.config :

 <configuration>
   <system.diagnostics>
     <trace autoflush="false" indentsize="4">
       <listeners>
         <add name="myListener"
           type="System.Diagnostics.EventLogTraceListener"
           initializeData="TraceListenerLog" />
       </listeners>
     </trace>
   </system.diagnostics>
 </configuration>

.aspx.vb?

Overloads Public Shared Sub Main(args() As String)

' Create a trace listener for the event log.
Dim myTraceListener As New EventLogTraceListener("myEventLogSource")

' Add the event log trace listener to the collection.
Trace.Listeners.Add(myTraceListener)

' Write output to the event log.
Trace.WriteLine(myTraceListener)

End Sub 'Main
+1

, , , . , , , .

+1

All Articles