The Problem
While working on a new WCF application, I ran into the following error while trying to run the service project and test the functionality of the methods:
Along with the error was the opportunity to click on “Yes” and shut down the debugging session, or to click on “No” indicating that I did not want to stop running the project, which was useless since none of the service methods were generated and hence, not testable. A screenshot of the error looks this:

As much as I love Microsoft, this is one of their famous error descriptions that tell you absolutely nothing about what is really going on. After several frustrating hours of investigation, I ended up deleting the entire service project in my solution and recreating it from scratch. This did fix the problem although I didn’t know why. Several days later when I accidentally updated the App.Confrig file with an errant key stroke I figured out the cause of the error, which I confirmed by testing several scenarios.
The Solution
The error was generated because the service name attribute in the App.Config file did not match the name of the service class for my service. So, as an example, here is a screen shot of the solution explorer from my Burn Notice service project.

The MichaelWesten class looks like this:
namespace BurnNotice.Service
{
public class MichaelWesten : IMichaelWesten
{
public string GetSpySkillDescription(int spySkillId)
{
return Data.GetSpySkillById(spySkillId).Description;
}
}
}
Everything works great if my App.Config file looks like this:
<services>
<service name="BurnNotice.Service.MichaelWesten">
<endpoint
address=""
binding="wsHttpBinding"
contract="BurnNotice.Service.IMichaelWesten">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/BurnNotice.Service/MichaelWesten/" />
</baseAddresses>
</host>
</service>
</services>
You will notice in line 2 above, that the name attribute of the service is “BurnNotice.Service.MichaelWesten”. This maps to the name of the project “BurnNotice.Service” with the name of the service class attached to it (“MichaelWesten” as seen in the solution explorer screenshot above).
An Explanation
If the name attribute in the App.Config is changed, however, like so (Notice the highlighted line):
<services>
<service name="BurnNotice.Service.WrongNameHere">
<endpoint
address=""
binding="wsHttpBinding"
contract="BurnNotice.Service.IMichaelWesten">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/BurnNotice.Service/MichaelWesten/" />
</baseAddresses>
</host>
</service>
</services>
Then the cryptic “cannot find any service metadata” error is the result. So … if you are getting this error, be sure to verify that your service name in the App.Config matches the class name that defines an actual service in your project.
Tags: metadata, service name, WCF, wcf error









Thank you for nice explanation. Was a bit confused by this error, until saw your post.
Thank you! This fixed my problem!
Gracias!