I have created a service using visual studio and installed it using visual studio command prompt. It works fine
But now I want to install the same service using a visual studio installer. I have created a installer by following this link. The installer does install the service properly as it does not throw any error or exception. But when I start the service from the service list, the service does start but it does not write into the log file. So can anyone help me and tell why the service performs OK while installed using command prompt but causing issues when installed through installer.
protected override void OnStart(string[] args)
{
timer1 = new Timer();
this.timer1.Interval = 5000;
this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_tick);
timer1.Enabled = true;
Library.WriteErrorLog("service started!");
}
private void timer1_tick(object sender, ElapsedEventArgs e)
{
Library.WriteErrorLog("Timer ticked succesfully");
}
protected override void OnStop()
{
timer1.Enabled = false;
Library.WriteErrorLog("Service Stopped!");
}