I'm hosting a service using WebServiceHost in my desktop application and not closing this service if the process is terminated. I checked the port I used after the process terminates and it was closed, and I was able to reuse the same port properly.
From this thread, the close only switch the state for the WebServiceHost object.
I found no threads warns not to use close. Does the desktop application disposes the object properly when done? Or it is required to close the service as the app terminates.
WebServiceHost WCFService = new WebServiceHost(wcs, httpBaseAddress);
WCFService.Open();
WCFService.Close(); // Is this line of code required when using WebServiceHost