Hosting Web API in Windows service

added by pwalat
6/10/2012 7:35:27 AM

5 Kicks, 360 Views

Running your api as Windows services can have multiple advantages, especially when working on bigger projects. This allows for multiple (services to run in isolation and gives fine grained control over your system components. ASP.NET Web API ships with self-hosting feature that allows to run HTTP service outside of IIS. This can be easily used in Windows services. In this blog post I am going to show how to host Web API service inside of Windows service, using both Windows Service Visual Studio project template and Topshelf library.


2 comments

dpeterson
6/11/2012 8:51:29 AM
Besides taking IIS out of the loop as far as administration responsibilities goes, I wonder what the advantages are to running as a windows service rather than under IIS?

timbolt8
6/12/2012 10:23:54 AM
I agree with d on this one...what would be the advantage of doing this? Less overhead as opposed to an IIS install?