WCF Add Service Reference gotcha with Windows Server

We recently switched from developing in Vista to Windows Server 2003. Someone had the bright idea that we should develop in the same environment the application is going to be hosted on. Go figure.

What that meant is that you run into wierd issues like this one. When trying to add a Service Reference to a WCF service hosted under IIS you keep getting this 'Add Service Reference Error':

Metadata contains a reference that cannot be resolved: 'http://merill/Services.Host/ClientProfile.svc?wsdl'.
The WSDL document contains links that could not be resolved.
There was an error downloading 'http://merill/Services.Host/ClientProfile.svc?xsd=xsd0'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Metadata contains a reference that cannot be resolved: 'http://localhost/Services.Host/ClientProfile.svc'.
Metadata contains a reference that cannot be resolved: 'http://localhost/Services.Host/ClientProfile.svc'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

The key part of this message is the reference to the downloading of the xsd. When I tried accessing the .svc url in a browser it worked fine, but trying to access the .svc?xsd=xsd0 brings up the generic 'cannot display webpage' message.

When you unleash your weapon (Process Monitor) on the csc.exe process (this is the compiler generating the xsd) you'll realise that the IIS identity IIS_WPG does not have access to the Windows\Temp folder. Give enough rights to the folder and viola problemo solved.

Happy WCF programming on Windows Server!

WCF Add Service Reference gotcha with Windows Server

Bill Gates was right about spam

In 2004 BillG made a statement that spam will be solved in two years. In 2008 I can prove that it is.

Here’s how my Inbox looks today.

Inbox

That’s 19,326 spam message caught in the last 30 days. Not a single spam slipped through and nothing was falsely flagged.

What he wouldn’t be happy about though is that it wasn’t his team that solved it but the guys over at GMail.

The Windows Live Mail client, unfortunately, flags my own messages as Junk.

Bill Gates was right about spam

Copy Paste Unformatted Text in Word

I was reading this old series of posts on the whole Office Ribbon bar design (quite a fascinating from a developer perspective). I came across the comments where quite a few have ranted on the 'paste unformatted text' as being more preferred than paste. I too used to be in that same group but that was before I came across this whole section dedicated to configuring copy-paste under the Advanced tab in Word options. Here you can configure the default paste action. For keyboard freaks there's always the Alt+H, V, S to get to the Paste dialog.

While we're on the topic of Copy/Paste. Do yourself a favor and install ClipX, you have absolutely no idea what your missing.

Copy Paste Unformatted Text in Word