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 got the below error when trying to start a WCF service. The full error message is: The Service on local computer started and then stopped, Some services stop automatically if there are not in use by other services or programs.

The Service on local computer started and then stopped

I faced this issue in a WCF application. I have installed the WCF as an windows service.

In the endpoint I put that as binding=”netTcpBinding”. But in the base address I was defining as below:

<baseAddresses>
    <add baseAddress=”http://localhost:8732/Design_Time_Addresses/MyTestWCF/Service1/”/>
</baseAddresses>

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 changed the base address to net.tcp and it worked for me. So my new baseAddresses is like below:

<baseAddresses>
    <add baseAddress=”net.tcp://localhost:8732/Design_Time_Addresses/MyTestWCF/Service1/”/>
</baseAddresses>

And my end point is like below:

<endpoint name=”NetTcpEndPoint” address=”” binding=”netTcpBinding” contract=”MyTestWCF.IService1″/>
Also check in  <behaviors> section. Inside <serviceBehaviors> the below line should be false.
<serviceMetadata httpGetEnabled=”False”/>

Now its working for me and I did not get any error.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>