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 ?
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">
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With