tags:

views:

482

answers:

3

Hi All

How to host the WCF service in windows service?

Thanks Sekar

+3  A: 

I just saw this today come across Channel 9:

http://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Hosting-WCF-Services-in-Windows-Services/

Will
+7  A: 

I thought this article did a pretty good job of covering the steps required: WCF Link

To summarize:

  • To start with you need to create a new visual studio project of the type "Windows Service".
  • Next to be able to install the service, you also need to write an installer class of the form:

.

 [RunInstaller(true)]
 public class ProjectInstaller : Installer
 {
 }
  • Add your WCF classes to the project, and in the OnStart and OnStop events of the windows service you'll have to explicitly start your WCF services.

  • From a visual studio command prompt you can install the service using the command

.

installutil myservicename.exe
John Sibly
A: 

pluralsight has an excellent screencast which will walk you through hosting your WCF service in a windows service

http://www.pluralsight.com/main/screencasts/screencast.aspx?id=hosting-in-windows-services

Dav Evans