I created a WCF project by going to Add New Project -> WCF service library and when I run it on the development environment, it opens up the WCF test client. How do I install this service on a server that doesn’t have Visual Studio installed (I’d like to not host it on IIS). Should I write a new windows service?
Share
Create a Windows Service project.
Add your WCF Service to this project.
In the main Windows Service class (defaults to Service1.cs), add a member:
Modify OnStart() to start a new ServiceHost with your WCF Service type:
Modify OnStop():
Add a Setup and Deployment project (Setup Project) to your solution. Set output of that project to be the main output of the Windows Service project. When you build the Setup and Deployment project, you should see a Setup.exe file that you can use to install the service.
Keep in mind you still need to setup your endpoints and bindings. Look into using nettcpbinding for this setup.
As a final note, reference: Error 5 : Access Denied when starting windows service if you are experiencing problems when starting the Windows Service after installation.