Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 16, 2012 06:01 AM by Peter pi - MSFT
Feb 10, 2012 04:59 AM|LINK
I have created a simple wcftestclient application. I used window server 2003,.net 3.5 framework. When run the application, it get the following error "Failed to add a service. Service metadata may not be accessible. Make sure your service is running and
exposing metadata." Please help me on this. The same application works on windows 7.
Here is the appconfig file:
<?xml version="1.0" encoding="utf-8" ?>
<compilation debug="true" />
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<endpoint address="ws" binding="wsHttpBinding" contract="EvalServiceLibrary.IEvalService">
<dns value="localhost" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="basic" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService" />
<add baseAddress="http://localhost:1374/Design_Time_Addresses/EvalServiceLibrary/Service1/" />
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<!-- 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" />
Feb 13, 2012 04:34 AM|LINK
See above the config file, it seems that there are no any issue in your app.config, but this error may be caused if the service did not start correctly. I want to know how did you host your WCF service? you can try to host your WCF service in an console application,
and also make sure that the objects being used to put DataContract and DataMembers for its repective properties.
Hope this hopes
Feb 13, 2012 05:50 AM|LINK
Thanks for your help on this issue.
Yes, the issue is not with the app.config file. I tested the same code in other environment and it was working good. The problem may be,i test the code where IIS have sharepoint environment. Its a Virtual PC where sharepoint is installed and running. So
i think they may be issue with that. So i tested in other environment where sharepoint is not running. I guess this may be the issue. Any idea?
Feb 16, 2012 06:01 AM|LINK
Based on my understanding, there is no problem hosting a WCF service on a virtual PC running sharepoint, but it is advisable to host it in a different website rathan than in sharepoint. Here is a article to which you can refer to.