WCF port still blocked after process exited RRS feed

  • Question

  • Hi all,

    I am running a WCF service within a windows service.

    Sometimes the ports of my WCF service do not get disposed correctly. Even after the process has exited, the port is still blocked by the Idle process.

    This is specially annoying, when I try to restart my service and get an exception, because the port is still blocked.

    The Idle process blocks the port up to 1 minute.

    How is this possible and how can I prevent it?

    Thanks for any help,


    Friday, April 25, 2014 3:27 PM

All replies

  • Hi,

    It seems that your service starts the child process and when service exits, the child continues to run. Because child inherits handles from parent, then when parent process is closed, the port is still kept open for the child.

    Then the solution for this question is to start child with ProcessStartInfo.UseShellExecute = true which will stop child from inheriting handles.

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, April 28, 2014 2:44 AM
  • Dear Amy,

    Sorry for the late reply.

    There is no child process which is blocking the port. It is the system's Idle process which blocks the port.

    Any other suggestions?

    Best regards,


    Tuesday, May 6, 2014 11:39 AM