Add Service Reference Failure RRS feed

  • Question

  • When trying add the reference of a service, becomes the following failure:

    The type 'Project.ServicesCatalog.LocalizationsLibrary.LocalizationsService', 
    provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element 
    system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

    Observations: In other services, the problem does not occur. They were created 2 projects.

    1 - WCF Application
    2 - WCF Library
    In SVC Markup:
    <%@ ServiceHost Language="C#" Debug="true" Service="Project.ServicesCatalog.LocalizationsLibrary.LocalizationsService" %>

    Wednesday, January 30, 2013 11:39 AM


All replies

  • Check to make sure your service element matches the class name you specified in your MyService.svc file

    For example (from your Web.config):

    <service name=”MyNamespace.MyService” behaviorConfiguration=”InternalWebService”>
    <endpoint address=”MyService” binding=”basicHttpBinding” contract=”Namespace.IService” bindingConfiguration=”InternalHttpBinding” bindingNamespace=”mynamespace” />

    The address attribute of the element endpoint must match the class name you specified in Service.svc.  If they do not, you will encounter the error above.

    namespace MyNamespace
    [ServiceBehavior(Namespace = "mynamespace")]
    public class MyService : IMyService, IDisposable

    Wednesday, January 30, 2013 1:17 PM
  • I checked my svc file with what is in the web.config and in the contract, but still giving the problem .. There are some other causes?
    Wednesday, January 30, 2013 3:26 PM
  • Hi,

    Suggest you take a look at an example here to help you find the problem.

    #How to: Host a WCF Service in IIS

    In addition, you can take a look at this thread on similar issue.

    Best Regards.

    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, January 31, 2013 2:56 AM