Windows service hosting WCF service is not starting

Publish date: 2024-07-30

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend DriverFix:
This software will keep your drivers up and running, thus keeping you safe from common computer errors and hardware failure. Check all your drivers now in 3 easy steps:
  • Download DriverFix (verified download file).
  • Click Start Scan to find all problematic drivers.
  • Click Update Drivers to get new versions and avoid system malfunctionings.
  • Windows Communication Foundation (WCF) is an essential part of any self-hosted server for Windows machine as it offers a framework for building service-oriented applications. At times after building a WCF project and installing the service you may encounter issues such as “Windows service hosting WCF service is not starting”.

    The issue can occur due to several reasons including port error, disabled .Net Framework options and more. In this article, we take a look at the possible solutions to help you diagnose and resolve the Windows service hosting WCF service is not starting issue in Windows.

    How to fix Windows service hosting WCF service is not starting

    1. Enable .NET Framework Features

  • Press Windows Key + R to open Run.
  • Type control and click OK to open the Control Panel.
  • From the Control Panel, go to Program > Programs and Features.
  • From the left pane, click on Turn Windows Features On or Off.
  • Check the “Net Framework 3.5” option. After that, enable the following option depending on the use.
    Windows service hosting WCF service is not starting
    For Web HTTP – Enable “Windows Communication Foundation HTTP Activation” option.
    For TCP, MSMQ – Enable “Windows Communication Foundation NonHTTP Activation” option.
  • Click OK to save the changes.
  • Reboot the computer and check if the error is resolved.
  • How to enable Remote Desktop on Windows Server 2019

    2. Register Network Service User

  • After creating the Windows Service, you need to register the Network Service user to listen on http port 8000 first. You can do this with the help of the following command.
  • Type cmd in the search bar.
  • Right-click on Command Prompt and select “Run as Administrator“.
    Windows service hosting WCF service is not starting
  • In the Command Prompt window type, the following command and press enter.
    netsh http add urlacl url=http://+:8000/ user=”NETWORK SERVICE”
  • It should give a success message.
  • Check again if the Windows service is started and working again.
  • If the issue persists, use the following command in the command Prompt.
    netsh http add urlacl url=http://+:8000/ sddl=”O:NS”
  • Both the commands do a similar task, so try whichever works for you.
  • 3. Check your Code Function for Error

  • Most of the time the Windows service hosting WCF service is not starting is the result of users own mistake in the function code.
  • For example, any issues in the OnStart function can affect the working of WCF service. Make sure you check the service for any not so obvious error and then try to restart the service again.
  • Conclusion

    By following the steps in this article you can resolve Windows service hosting WCF service is not starting issue in Windows computer. Do note that the solutions vary depending on the individual user problem unless the issue is with the WCF or Windows features itself.

    RELATED STORIES YOU MAY LIKE:

    ncG1vNJzZmivmaOxsMPSq5ypp6Kpe6S7zGiuoqaUpMS0eceoqq2hnpx6uK%2FFZqqeqqaesKZ5zairZquklr%2B1tc2gZg%3D%3D