Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Service '' has zero application (non-infrastructure) endpoints

Tags:

wcf

i keep getting an unexplained exception

 Service 'EmployeeManagerImplementation.EmployeeManagerService' has zero application (non-infrastructure) 
 endpoints. This might be because no configuration file was found for your application, 
 or because no service element matching the service name could be found in the configuration file,   or because no endpoints were defined in the service element.

iv'e come across other posts which have solved this problem , but no one seems to have a precise answer , and non of their solutions worked for me .

Service has zero application (non-infrastructure) endpoints

any ways here's my app.config

 <system.serviceModel>
    <services>
        <service name="Some.Test.EmployeeManagerService">
            <endpoint address="net.tcp://localhost:8080/Service" binding="netTcpBinding"
                bindingConfiguration="" contract="Contracts.IEmployeeManagerService" />
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>
    </services>
</system.serviceModel>

my Contract:

[ServiceContract(Namespace="Some.Test")]
public interface IEmployeeManagerService
{
    [OperationContract]
    string Test();    
}

My Service :

public class EmployeeManagerService : IEmployeeManagerService
{
    public string Test()
    {
        return "test";
    }
}

in the related post people advised to give the Contract a namespace , and to use that as a prefix in my app.config for the name in the service tab .

also there was a suggestion to expose the mex end point ... i don't really see what this as to do with it but i did it any ways .

so any ideas of why this happens ? and how to really resolve this issue ?

like image 453
eran otzap Avatar asked Mar 21 '12 23:03

eran otzap


2 Answers

From your own comment:

Set the name attribute of the service to the exact same name as the implementation including the namespace

<service name="EmployeeManagerImplementation.EmployeeManagerService">

like image 194
Phil Patterson Avatar answered Nov 11 '22 21:11

Phil Patterson


Copy app.config from service to console app which is hosting the service

If you have created the service as a class library project and you are using console application to host it then just copy the app.config file from the service into the console application

like image 45
ziaprog Avatar answered Nov 11 '22 20:11

ziaprog