Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Service on local computer started and then stopped ,Some services stop automatically if there are not in use by other services or programs

I created one sample windows service and installed my service with successfully. But while going to START the service. I am getting below error.

This sevice on local computer started and then stopped. some serivces stop automatically if then are not in use by other serives or programs

enter image description here

My config 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 any one please suggest me... Thanks in adv.

like image 614
Jagadeesh Avatar asked Oct 21 '22 01:10

Jagadeesh


1 Answers

You need to specify the endpoint of the service (the URI at which the service can be reached by the client).

You can do it in the code where you instantiate the ServiceHost (a very generic example):

ServiceHost myHost = new ServiceHost(typeof(TechResponse), new Uri("http://www.somedomain.com/TechResponse"));
like image 56
Tim Avatar answered Nov 04 '22 19:11

Tim