Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 105,763 C# Programmers for FREE! Ask your question and get quick answers from experts. There are 1,691 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Trying to implement Windows SErvice, but InstallUtil seems to attempt

 
Reply to this topicStart new topic

Trying to implement Windows SErvice, but InstallUtil seems to attempt, Issues with VS2008 and InstallUtil

Pithecanthropus
post 13 Jul, 2008 - 07:52 PM
Post #1


New D.I.C Head

*
Joined: 13 May, 2008
Posts: 9

I'm trying to learn how to work with Windows Services, so I've written a trivial one--actually, I've ripped off the code from some example on the Web. I think it was msdn.

I developed it in C# using VS2008. Everything compiles, and I have the ServiceInstaller and ServiceProcessInstaller classes set up. But when I run InstallUtil to install it, I get the error in bold below.

nstalling service mcWinService...
Service mcWinService has been successfully installed.
Creating EventLog source mcWinService in log Application...
Installing service mcWinService...
Creating EventLog source mcWinService in log Application...

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The specified service already exists


It looks very much like installUtil is trying to do this twice. Contrariwise, when using the /u parameter, the service is not recognized as being there:

Service mcWinService is being removed from the system...
An exception occurred during the uninstallation of the System.ServiceProcess.Ser
viceInstaller installer.
System.ComponentModel.Win32Exception: The specified service does not exist as an
installed service
An exception occurred while uninstalling. This exception will be ignored and the
uninstall will continue. However, the application might not be fully uninstalle
d after the uninstall is complete.
Removing EventLog source mcWinService.

At no time ever does my service appear to exist, via either the Services window under Admin Tools, or the DOS command line [/b]sc query tool, or the Uninstall/Install Programs tool in Control panel. This is on a Vista Business OS.

Can anyone help? Why does InstallUtil try to install twice?
User is offlineProfile CardPM

Go to the top of the page


nbarten
post 15 Jul, 2008 - 07:47 AM
Post #2


D.I.C Head

**
Joined: 30 Apr, 2007
Posts: 112



Thanked 1 times
My Contributions


As far as i have experienced installutil works fine... so i guess it's your code.

What settings do you have in your service installer class, or do you have more than 1 installer class?
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/21/08 01:40PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month