Search Insightful Coder Insights in software engineering Menu About Search Search for: Close search Close Menu About Categories Uncategorized WCF and Sharing Ports Post author By Insightful Coder Post date July 15, 2013 No Comments on WCF and Sharing Ports WCF can become a tricky beast to configure once you start hosting multiple services on the same port not to mention hosting it inside a Windows service. I ran into a few challenges in getting things up and running. Hopefully this short article might save
Sharing ports among WCF services can become an issue when dealing with production environments. Many examples that you find use a different port for each WCF service that is created. This approach works fine for prototyping and in academia. However your IT guy will probably break into a diatribe about security and maintainability when you want to deploy the service. This is especially true if you are deploying to a client’s network. So let’s save the IT guy unnecessary stress and share a port. I encountered
The first obstacle was hosting multiple services inside a Windows service. I really prefer hosting WCF in IIS, but that is another discussion. Suffice it to say that the due to design choices beyond my control and prior to my tenure on the project, WCF services were hosted in a Windows service. I created a simple Windows service to act as a host. Here is the code called by the Service Control Manager when the Windows Service is started and stopped.