Search code examples
c#wcfserviceinstallutil

Windows service starts and then stops when installed in debug folder


I have a selfhosting WCF Service. It is hosted by an Windows Service. I installed it with installutil. So in the bin Folder I have two Folders Debug and Release. When I install the windowsservice in the release Folder it starts as usual and hosts the WCF Service but when I install it in the debug Folder it wont start. I get this error message:

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

Does someone know how to fix this?


Solution

  • Some exception occurred. Check:

    1. Your logs (if you have such)
    2. Event log
    3. If you can attach a debugger then try it, the best option is to add some diagnostic line of code example here: https://msdn.microsoft.com/en-us/library/cktt23yw.aspx