← All articles

Sleep Deprived WCF Error

A WCF 'metadata unavailable' error, caused by a missing type in the namespace path or an enum using DataMemberAttribute instead of EnumMemberAttribute.

Donn Felker

Donn Felker

2008.10.11 · 1 min read

I just got off a really long week at a client setting up Team Foundation Server. Tonight I was putting some final touches on my WCF portion of my Twin Cities Code Camp talk that is going to be tomorrow. Having a 4 week old baby and having travlled all day yesterday with no sleep due to the baby has left me in an “altered state”. AKA: I’m not running on all cylinders right now. Anyway … to the good stuff…

I kept getting the following error:

“The client was unable to retrieve service metadata. Make sure the service is running and exposing metadata.”

image

I found a post by Julie Lerman here that spoke of the same issue. Well, this is also my “Stupid” mistake.. except all of my namespaces were incorrect. However my problem was that I had taken the configuration for the service and forgot to add on the actual type declaration. So instead of the namespace being:

TwinCitiesCodeCamp.SmoothOperator.OrderService.OrderService 

… I had it as …

TwinCitiesCodeCamp.SmoothOperator.OrderService  

The type declaration was missing. Leaving this off will give the WCF Test Client problems. I do have to give it up to Microsoft because this Test Client was not in VS2005. It has helped me fail fast in this scenario.

Oops. Need sleep.. .

Update: This error can also occur if you happen to put a “DataMemberAttribute” on a Enum value. It should be set to “EnumMemberAttribute”.

Donn Felker

Written by Donn Felker

I've spent 25+ years shipping software, writing books, and running my own companies. I write about thinking clearly, working for yourself, and doing real work while AI rewrites the rules. New essays land here every week.

Get the newsletter

Keep reading