If I were to change the web.config file to have errors in it, I only see the standard 500 – Internal Server Page.
Despite setting the Error Pages mode to Detailed, I can't see a detailed error message. How do I sort this?
The reason is I'm wanting to make changes to a WCF service to add tracing, but that gives a 500 error, so I want to see what this 500 error is.
I have the following in the web.config file:
<system.webServer>
<httpErrors errorMode="Detailed" />
...
</system.webServer>
<system.web>
<customErrors mode="Off" />
...
</system.web>
Best Answer
WCF tracing can be more complex to configure that the usual web.config settings for an IIS web site.
If you want the information returned to the client (which should only be done in development), try the includeExceptionDetailInFaults setting:
http://msdn.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.includeexceptiondetailinfaults.aspx
However, a far more useful tool is the tracing to a file that you can process with the Service Trace Viewer application. This is typically located at:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\svctraceviewer.exe
on your machine where you have your Windows Development SDK installed.Configuring Tracing
http://msdn.microsoft.com/en-us/library/ms733025.aspx
Service Trace Viewer Tool (SvcTraceViewer.exe)
http://msdn.microsoft.com/en-us/library/ms732023.aspx
You can log transport-level activity, and if you have message security, message activity. Usually a separate file is created for each. An example of one way to configure:
Assuming everything is configured correctly, the files will be generated. When the exception occurs, you can copy the file to the machine where svctraceviewer is installed, and open it. Typically you can navigate to the datetime when the issue occurred and find it. If you are sifting through a lot of activity, svctraceviewer has excellent filtering. Exceptions appear highlighted as red in the left pane. You can click on the exception to find the exception detail.