Windows Service project doesn't install using VS 2005

  • Thread starter Thread starter JM
  • Start date Start date
J

JM

Hi,

I have created a Solution in VS 2005 with 2 simple projects.

First project is simple Windows Service which writes an entry into
event log when it starts and when it stops. Nothing else. I have added
a projectinstaller also for that. I have used following settings for it
(developed in VS 2005 only):

1. For Service1.cs file, I have kept the default values. i.e. Name of
Service is Service1 only.
2. For ProjectInstaller.cs file, I have account = LocalSystem and
StartType = Automatic.

Second project is Setup and Deployment project with the "Primary
output" selected for the above project. It does copies the exe file of
the service under program files, BUT doesn't install the service.

I have tried all things but my setup project doesn't install the
service on my PC and I can't see the service under "Services panel" on
my PC. I am running XP professional.

I was having VS 2003 also running on my PC and I have created a service
under that which is running fine.

Does anybody has any clue why this is happening !!

Thanks in advance
JM
 
go to the folder where the exe file is created( in the debug or release
folder of the project) using Visual Studio .Net 2005 Command Prompt.

Type following in the prompt:
installutil <service_file.exe>

where <service_file.exe> is the executable of the service.
Hopefully this should install the service. If everything goes fine,
start the service under Services
 
Thanks a lot for your help. It worked like a charm. My service is
installed and I have started it succesfully.

But I would still like to install it using VS 2005 Setup program. Do I
have to do something else for this.

Regards
JM
 
As far as Windows Setup file is concerned, U must be making some small
mistake or are forgetting some thing. as the service installed
successfully, there should be no probs with the C# files. Just repeat
all the steps carefully.
I suppose u r doing this from the C# Certification book. You must be
missing something. Check properly.
 
Back
Top