The service on the local computer started and then stopped. Some services automatically stop when other services or programs are not in use.

I created one trial Windows service and successfully installed my service. But while you are about to START the service. I am getting below the error.

This service on the local computer started and then stopped. some serivces automatically stop if they are not used by other programs or programs

enter image description here

My configuration file Code:

<system.serviceModel> <services> <service name="SvcClient.WCFJobsLibrary.Service1"> <endpoint address="" binding="wsHttpBinding" contract="WCFJobsLibrary.IService1"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:8732/Design_Time_Addresses/WCFJobsLibrary/Service1/" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior> <!-- 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> </behaviors> </system.serviceModel> 

Can anyone suggest me ... Thanks in adv.

+4
source share
1 answer

You need to specify the service endpoint (the URI at which the client can access the client).

You can do this in code where you create an instance of ServiceHost (a very general example):

 ServiceHost myHost = new ServiceHost(typeof(TechResponse), new Uri("http://www.somedomain.com/TechResponse")); 
+2
source

Source: https://habr.com/ru/post/1501047/


All Articles