Windows service startUp error

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Hi all,

My question consists of 2 parts:

1) I have installed my windows service [by right-click on Setup.exe in
SolutionExplorer, then Install ... ] onto a folder on my desktop. When I
click on the MyNewService.exe file, I got the following error message:

" Cannot start service from the command line or a debugger. A Windows
Service must first be installed (using installutil.exe) and then started with
the ServerExplorer, Windows Services Administrative tool or the NET START
command. "

2) Is the problem because I need to install using "installutil /i
C:\MyNewService3.exe" ?
I tried that and i got the error message:

" Exception occurred while initializing the installation:
System.IO.FileNotFoundException:
File or assembly name Documents, or one of its dependencies, was not found. "

Any advice on understanding what this message says ?
Thanks.

regards,
Andrew
 
Well you definitely need to get the service installed properly, yes.
InstallUtil is generally used (although setup projects of various types may
use the more conventional installation techniques).

The exception indicates that your assembly has a dependency that's missing,
although the fact that it's called Documents seems odd to me, unless of
course you actually have a reference to an assembly of that name, and it is
unavailable.

Have you by any chance added a CustomActionData property that's being passed
into the Install method of your installer class? I've seen some issues in
this area.
 
" Cannot start service from the command line or a debugger. A Windows
Service must first be installed (using installutil.exe) and then started with
the ServerExplorer, Windows Services Administrative tool or the NET START
command. "
If it is a windows service then you must start it from the services
control panel

If you want to make it optionally run from a console window, you need
to add some logic in your main so that ServiceBase.Run is not called.

Mitch
 
Back
Top