Search code examples
c#windows-servicesvisual-studio-2008-sp1autostart

How to auto start window service


I have a window service which i developed in c# (vs2008). please tell me what should i do to make it auto start after installation and also auto start on every time when system gets restarted.

EDIT: I am using setup & deployment project to install it. Thanks


Solution

  • Follow the instructions given here to add an installer to your Service application. Pay particular attention to step 5, where you set the StartType property.

    To start the service after installation, see Automatically start a Windows Service on install