

Than open Properties of your service_name.exe file. NOTE: goto bin\Ddebug folder of your project folder. Remove static void main method from Program.cs file. than right-click on serviceProcessInstaller1 and change its property value of Account from User to Local System. than right-click and select Add Installer. Right-Click on service_name.cs file and open designer of service. Protected override void OnStart(string args)ĮventLog.WriteEvent("Timer_Service", new EventInstance(0, 0, EventLogEntryType.Information), new string ) Timer_Service service = new Timer_Service() Public partial class Timer_Service : ServiceBase Than copy following code into your service_name.cs file. Open Visual studio and select new project by selecting Windows Service template in Windows Desktop tab.
