windows service does not start

M

Mark

I created an extremely simple windows service that only writes to the
EventLogs on Stop and Pause. I installed it using the InstallUtil.exe
program, the output of which is below. It appears to be successful. I'm
now ready to start my service (I think) but the NET START command does not
appear to indicate that the service is available to be run. The output for
NET START is below as well. The Services list in the W2K administrator
tools does not display the service either. The name of my service was set
by VS.NET in the InitializeComponent method as ...

this.ServiceName = "cDcdMain";

How exactly do I start my service? Thanks in advance.

mark



*** DOS OUTPUT BELOW ***

C:\Temp\test>InstallUtil.exe MyService.exe

Microsoft (R) .NET Framework Installation utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the c:\temp\test\MyService.exe
assembly's progress.
The file is located at c:\temp\test\MyService.InstallLog.
Installing assembly 'c:\temp\test\MyService.exe'.
Affected parameters are:
assemblypath = c:\temp\test\MyService.exe
logfile = c:\temp\test\MyService.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be
found in the c:\temp\test\MyService.exe assembly.

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the c:\temp\test\MyService.exe
assembly's progress.
The file is located at c:\temp\test\MyService.InstallLog.
Committing assembly 'c:\temp\test\MyService.exe'.
Affected parameters are:
assemblypath = c:\temp\test\MyService.exe
logfile = c:\temp\test\MyService.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be
found in the c:\temp\test\MyService.exe assembly.
Remove InstallState file because there are no installers.

The Commit phase completed successfully.

The transacted install has completed.

C:\Temp\test>net start
These Windows services are started:

Application Layer Gateway Service
Application Management
Automatic Updates
Background Intelligent Transfer Service
COM+ Event System
Computer Browser
Cryptographic Services
DefWatch
DHCP Client
Distributed File System
Distributed Link Tracking Client
Distributed Transaction Coordinator
DNS Client
Error Reporting Service
Event Log
Help and Support
HTTP SSL
IIS Admin Service
Internet Connection Firewall (ICF) / Internet Connection Sharing (ICS)
IPSEC Services
Logical Disk Manager
Machine Debug Manager
Net Logon
Network Connections
Network Location Awareness (NLA)
Plug and Play
Print Spooler
Protected Storage
Remote Access Connection Manager
Remote Procedure Call (RPC)
Remote Registry
Secondary Logon
Security Accounts Manager
Server
Shell Hardware Detection
Symantec AntiVirus Client
System Event Notification
Task Scheduler
TCP/IP NetBIOS Helper
Telephony
Terminal Services
Windows Audio
Windows Management Instrumentation
Windows Time
WinHTTP Web Proxy Auto-Discovery Service
Wireless Configuration
Workstation
World Wide Web Publishing Service

The command completed successfully.


C:\Temp\test>
 
K

Ken Kolda

It sounds like you didn't create an installer for your project. Within your
project add a new Installer class (it's an option in the VS.NET "Add Item"
list). To that installer add a ServiceInstaller and a
ServiceProcessInstaller (both listed in the Components browser). Set their
properties (the service name of the serviceinstaller must match the name of
your service) and then recompile and re-run InstallUtil. You shouldn't see
the message about "No public installers" and you should see your service
added to the list of available services.

Good luck -
Ken
 
M

Mark

THANK YOU!!!!!! You just saved me a ton of time.

The fact that the windows service template in VS.NET does not come with an
Installer class by default implies that a Windows Service frequently does
not require these classes. Could you please give a brief conceptual example
of when this would be the case?

Thanks again.

mark
 

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