Ever had a problem with a IIS-hosted WCF service suddenly deciding not to work anymore, despite no apparent change has been made to your system? The culprit is probably some weird windows update, or maybe your corporation (like mine) likes to automatically distribute registry hacks that have only been tested on “clean” boxes with nothing more than Office installed, not developer boxes. Anyway, when you surf in to your service with a web browser, instead of being greeted by that nice blue/white/beige standard screen, you get your .svc file just spit back out to the browser with no interpretation at all from IIS.
There can be a dozen different reasons for this, of course, most of which can be solved by a good old fashioned
C:\WINNT\Microsoft.NET\Framework\v3.0\Windows Communication Foundation>ServiceModelReg.exe -i
to reset the IIS metabase’s scriptmappings. But sometimes that won’t do it, and one thing that’s worked for me a bunch of times, that I haven’t seen anyone else writing about, is to simply go to the Properties dialog on your service’s virtual directory, and on the ASP.NET tab switch ASP.NET version to 1.1, apply, and then switching back to 2.0. This apparently resets something useful, and your service is interpreted correctly again.
Of course, just because this works for me doesn’t mean it will work for you. Your problem may be completely different, and my solution may do nothing at all for you, and if so, don’t come complaining to me. But it’s a low-risk, fast and simple little thing that you can try if your service is acting up.