Hi
I Create service using C#.I use the coding part of test to create servicee.Once I start the service it gave me message saying
"Myservice on local computer started and then stoped.Some services
stop automaticaly if they have no work to do,for example ,the performance logs and alerts service"
below I mention the coding part
protected override void OnStart(string[] args)
{
eventLog1.WriteEntry("Test", EventLogEntryType.Information);
FileStream fs = new FileStream(@"c:\temp\mcWindowsService.txt", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter m_streamWriter = new StreamWriter(fs);
m_streamWriter.BaseStream.Seek(0, SeekOrigin.End);
m_streamWriter.WriteLine(" mcWindowsService: Service Started \n");
m_streamWriter.Flush();
m_streamWriter.Close();
}
I write the coding for Stop function.Please help me to slove this problem.