Win Service only works in debug

jeffpeters

Member
Joined
Jul 28, 2006
Messages
14
Programming Experience
5-10
Hi
I've written, installed, started and debugged my vb.net 2005 windows service and all works fine.

But only while I am debugging it in Visual studio 2005.

Any idea how I can get my WS to work while not debugging it with Visual Studio open?

Thanks in advance

Jeff
 
What do you mean? Debugging a Windows Service in VS can't be done inherently starting from VS. A Windows Service must be installed with InstallUtil, then you start it as normal. It is only after the service is running without debugging you can attach the debugger to the service. So what you say don't make sense.
 
John

Thanks for the reply.

Obviously I am getting things a little muddled. Let me explain further. I have compiled my WS and installed it without a problem. It works on a timer tick so I expect it to perform its function every second. (Its function is to put a message in a message queue but I guess that is irrelevant)

When I start the service from the SCM nothing happens. But if I then run it in Visual Studio 2005 in debug mode it runs thru the breakpoints and functions correctly every second (new message in queue).

My question is why when I start the WS in the SCM do I not see any new messages?

Thanks in advance

Jeff
 
Not getting through here. You claim you can run a WS with VS, I say you can not. Only when a service is running as normal, that would be after it is compiled and installed with installutil and started through services list from control panel, only after all this is it possible to attach an debugger to it. Please level with this. Also you are not communicating what involves you "see messages".
 
Hey I think this is ur problem. go to the services. right click ur service and go through properties-> log on and place tick in the allow service to interact with the desktop. if the problem is solved ask me to give the code, if this is not ur problem. can u please explain what is scm

thanks in advance
Naresh
 
Back
Top