The best approach is to build a Windows Service to also run as a console application. The pattern is described in “Run Windows Service as a console program” here:
http://tech.einaregilsson.com/2007/08/15/
run-windows-service-as-a-console-program/
This should eliminate much of the problems described in “Debugging Windows Services is a Pain” here:
http://theimes.com/archive/2006/12/28/
Debugging-Windows-Services-is-a-Pain.aspx
Windows services are installed with Installer Tool (Installutil.exe) described here:
http://msdn2.microsoft.com/en-us/library/50614e95(vs.80).aspx
There is an Installer tool for one version of .NET up to .NET 3.5:
%SystemRoot%\\Microsoft.NET\\Framework\\v2.0.50727\\InstallUtil.exe
This tool will not work on the compiled assembly without running the Add Installer command described in “Creating a Windows Service in .NET” here:
http://www.developer.com/net/csharp/article.php/10918_2173801_2
It is also covered by Microsoft under the misleading title “How to create a Setup project for a Windows Service in Visual Basic .NET or in Visual Basic 2005” here:
http://support.microsoft.com/kb/317421/en-us