I am getting the following error ' The MYWidowsService service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.' when I try to start the wcf service hosted as Windows service .
The following is the code in onstart() of windows service
if (m_Host != null)
Uri httpUrl = new Uri("http://localhost:8090/MyService/SimpleWindowsService");
m_Host = new ServiceHost(typeof(MYWCF.Service1), httpUrl);
m_Host.AddServiceEndpoint(typeof(MYWCF.IService1), new WSHttpBinding(), "");
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
Please give me the solution.
Thanks an advance.