I use VS2010 Win 2008 R2. I created a "WCF service library", put it in a virtual directory in IIS and converted that to an application.
I put the svc file in root of the application and changed the output build path to bin
. Every time when try the URL http://localhost/test1/Service1.svc
I receive the error "Metadata publishing for this service is currently disabled".
I also tried the URL http://localhost/test1/MEX
. Mex behavior is configured correctly but this error appears.
When I try to add a service reference to a console application it also can't find metadata for service.
Can you please share you configuration file serviceBehavior section?
It should be something like this to enable Metadata exchange.
<serviceBehaviors>
<behavior name="SampleServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>