Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging HTTP 500 (Internal Server Error) in WCF Service / Staging

Tags:

iis-7

wcf

I have some WCF services which are running great locally; client can consume them and the server is putting data in the DB as expected. The problem is that when I deploy these to a staging machine, all I can see are HTTP 500 errors.

How do I start debugging the problem?

Given that it's only on staging and not on my local dev machine, I assume it's an IIS configuration problem somewhere.

When I use Fiddler to see what's being sent and what the response is, I can see (as expected) correct request data, and only a 500 as the response -- no further details.

I'm pretty green to WCF and IIS, so it's probably something obvious; I've used aspnet_iisreg, deployed my .svc file and all the built DLLs/files from bin; maybe I missed something.

I looked in the IIS logs, but they're pretty skimpy; no error information there, either (or maybe I'm looking in the wrong place?)

(More important than solving the specific problem is figuring out how to see enough details about errors so I can work through problems myself.)

Edit: I of course checked the event logs first -- and surprisingly, didn't find any mention of the exceptions. So I assume that the service is at least being invoked, and that something is faulting in the middle.

like image 485
ashes999 Avatar asked Nov 10 '11 14:11

ashes999


2 Answers

The first place to look for errors is event log on the server. There should be basic information why request was not processed. If it is WCF related you can turn on WCF tracing and check for more details in generated logs.

like image 67
Ladislav Mrnka Avatar answered Oct 22 '22 08:10

Ladislav Mrnka


Add:

<httpErrors errorMode="Detailed"/>

In Web.config under:

<system.webServer>

And see what's happening in more details.

like image 3
Alaa Avatar answered Oct 22 '22 07:10

Alaa