windows service newbie question

D

David C

I have been following this tutorial to write a windows service and
deploy it.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/h
tml/vboriCreatingConfiguringWindowsServiceApplications.asp

What a laborous process!

After I uninstalled it, I tried to reinstall it again to be greeted by
this message

"The specified service is marked for deletion."

Only after I reboot my XP, does it completely uninstall.

Is this normal? Now I am trying to learn how to debug, and because it
is a service, you have to install it, and attach the debugger. Fine.
Does this mean everytime I change the code, I need to install it and
reboot to uninstall?
 
G

Guest

Hi David,
instead of trying to debug your service place all of your logic inside a
class library, unit test that (i.e. using NUnit) and you will not have to
debug the code from your service which is painful.

Mark R Dawson
http://www.markdawson.org
 
M

Michael C

David C said:
I have been following this tutorial to write a windows service and
deploy it.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/h
tml/vboriCreatingConfiguringWindowsServiceApplications.asp

What a laborous process!

After I uninstalled it, I tried to reinstall it again to be greeted by
this message

"The specified service is marked for deletion."

Only after I reboot my XP, does it completely uninstall.

Is this normal? Now I am trying to learn how to debug, and because it
is a service, you have to install it, and attach the debugger. Fine.
Does this mean everytime I change the code, I need to install it and
reboot to uninstall?

Hi David,

If you stop your service before uninstalling it then it will be deleted
immediately. It is getting marked for deletion because it is running. Also,
if you want to compile it again just stop the service, compile it and start
it again, there's no need to uninstall and install it each time. Also, what
mark said is good advice although you should not let that stop you from
testing it as a service because code can behave differently.

As an unrelated issue, you don't need to add an installer to your project to
install the service, I just install it using the windows API which is just a
couple of fairly simple calls. I presume that's what you were talking about
when you said it was a labourious process.

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top