Services

G

Guest

Hi

I'm trying to write a service. It's a pretty simple thing at the moment that just writes to the EventLog, just so I can get my head around the basics of writing Services. It's compiled fine in Visual Studio, but I'm having a bit of bother getting it to run

Visual Studio says to use InstallUtil.exe to install the service first, so I used it as follows

installutil /AssemblyName myServic

Which appeared to run fine, but the service does not appear in my services list, and I found the following in the install log

No public installers with the RunInstallerAttribute.Yes attribute could be found in the c:\blahblah\myService.exe assembly
Remove InstallState file because there are no installers

I assume this is the reason why it doesn't appear in the services list. What should I be doing differently? There doesn't appear to be a lot of help in the docs for this

Burns
 
D

Doug Forster

Hi,

You need to add an Installer class to the project (the wizard will show this
as one of the choices) and then add a ServiceProcessInstaller and a
ServiceInstaller component to the Installer. Read the docs on these and it
will become clearer.

Cheers

Doug Forster

Burns said:
Hi,

I'm trying to write a service. It's a pretty simple thing at the moment
that just writes to the EventLog, just so I can get my head around the
basics of writing Services. It's compiled fine in Visual Studio, but I'm
having a bit of bother getting it to run.
Visual Studio says to use InstallUtil.exe to install the service first, so I used it as follows:

installutil /AssemblyName myService

Which appeared to run fine, but the service does not appear in my services
list, and I found the following in the install log:
No public installers with the RunInstallerAttribute.Yes attribute could be
found in the c:\blahblah\myService.exe assembly.
Remove InstallState file because there are no installers.

I assume this is the reason why it doesn't appear in the services list.
What should I be doing differently? There doesn't appear to be a lot of
help in the docs for this.
 

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