Friday, January 18, 2008

I was moving some code around and had a nice WCF Service Interface and Service Class created. So I copied them into a new project where I was re-creating my work.

When I tried to debug (self-host) the service, just to test it out with the embedded WCF Test Client.

But I kept getting this error:

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

This made no sense. My config file was fine. I even created a new WCF service in the solution, confirmed that it worked properly, then compared the config files line by line.

No problems.

After going around in circles for a while (including getting zero google results for that error message), a thought occurred to me. I copied and pasted the entire contents of the Interface and the service class. I hadn't changed the namespace!

That was the problem. I fixed the namespace and the service ran in the Test Client just fine.

Friday, January 18, 2008 4:52:42 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 
Friday, January 18, 2008 5:33:09 PM (Eastern Standard Time, UTC-05:00)
The actual lesson (for these kinds of scenarios) is:
put your contracts in their own DLL and share it.
Friday, January 18, 2008 6:00:28 PM (Eastern Standard Time, UTC-05:00)
Aha, but it was it's own DLL! I was extracting code from another DLL and putting it into a new lighter wieght one. But good to know from you that this is the right way. :-)
Julia Lerman
Friday, October 10, 2008 10:04:21 PM (Eastern Standard Time, UTC-05:00)
Thanks for the post. This pointed me in the right direction. Here was my result: http://blog.donnfelker.com/post/Sleep-Deprived-WCF-Error.aspx
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview