I know this question has been asked twice.But both of them didn't help me.My code is working fine like onstart is for initialization the timers etc. I have C# windows service which is running as some accnt not local. Im currently using CCtray to deploy and start the service so it doesn't give me any error. But sometimes manually I need to stop and start it again.And that's where I see this msg. I know microsoft has a hotfix for sp1 but I don't know whether they have for sp2.And my server where service is located is sp2.
1
votes
Consider fixing your own code before fixing Microsoft's. Trap all exceptions and log them to an event log. It might already be there.
– Hans Passant
Actually I used the registry change soln. and it worked.My other question is does it take 60-65 sec to start the windows service for all ppl who have created a C# windows service or it is just mine.
– alice7
please post the onstart() code in here. Someone will help you out. Thanks
– vnRock
I got i resolved by spawning a new thread in on start event which made it fast.
– alice7
2 Answers
1
votes
I know microsoft has a hotfix for sp1 but I don't know whether they have for sp2.And my server where service is located is sp2.
If we made a hotfix for SP1, the fix is already in SP2. Also, don't do anything in the OnStart, start up a separate thread to do anything and respond to SCM requests as fast as possible.
0
votes
One other reason is If you copy the DLL in 'debug' mode to installation folder this issue will come.What you need to do is Run the project in 'Release' mode copy the DLL or directly form Release folder rather than Debug folder,,and copy that DLL in to installation folder,it will work.You can see the reduction in size of DLL ,it will not contain any debug symbols and like that