• Register
1 vote
1.1k views

Problem :

Whenever I create the new Windows Service in my Visual Studio 2010, I often face the message stating to use the InstallUtil and after that net start to run the service.

I have tried the below steps:

1. I created the new project File -> New -> Project -> Windows Service

2. Gave the Project Name: MyTestService

3. Build my project as is (Service1 constructor, OnStart, OnStop)

4. I opened the command prompt, and ran "C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" MyTestService.exe

5. Ran  the net start MyTestService.

The Output of my step 5

The service name is invalid.More help is available by typing NET HELPMSG 2185.

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

 Please be sure that your ProjectInstaller class should be public. To be very precise I added the event handlers to my ProjectInstaller.Designer.cs, as shown below :

this.serviceProcessInstaller1.BeforeInstall += new System.Configuration.Install.InstallEventHandler(this.serviceProcessInstaller1_BeforeInstall);

I think during your automatical process of creating the handler function in the ProjectInstaller.cs it might have changed my class definition from

public class ProjectInstaller : System.Configuration.Install.Installer

to the

partial class ProjectInstaller : System.Configuration.Install.Installer

so replacing your public keyword with the partial. That is why, in order to fix the issue it must be done as

public partial class ProjectInstaller : System.Configuration.Install.Installer

Also note that I use the Visual Studio 2013 Community edition.

9 7 4
38,600 points

Related questions

0 votes
1 answer 3 views
3 views
Problem: I've also tried to revert sources to the last working version, but nothing else happens: net start outputs: The service is not responding to the control function. What could cause this malfunction?
asked Mar 20 ummesalma 22.9k points
0 votes
1 answer 14 views
14 views
Any idea how to solve this issue: Audio Service Not Starting/Functioning Properly
asked Mar 8 ummesalma 22.9k points
0 votes
1 answer 8 views
8 views
Problem: After debugging and installing windows service in windows 8 I have an error when I try to start a windows service:"The Windows could not start service on local computer Error 5 Access is denied"
asked Mar 8 ummesalma 22.9k points
0 votes
1 answer 5 views
5 views
Problem: I have created and installed a service a couple of times. Initially it was working fine, but after some changes in the service Code it start giving the error when I restart the service in Services.msc : Error 1053: the service did not respond to the start or control request in a timely fashion
asked Mar 20 ummesalma 22.9k points
1 vote
1 answer 620 views
620 views
Problem : I am very new to C#. I am trying to execute my code related to windows service but I am unable to execute the code I am facing below error. Cannot start service from the command line or debugger. A winwows Service must first be installed(using installutil. ... looking for expert advice on fixing above error as I have already spent a lot of time in fixing it but with no positive results.
asked Apr 10, 2020 morrisBson 3.2k points
1 vote
1 answer 64 views
64 views
Problem : I am very new to Windows Services. Currently I am trying to create a custom windows service. I am trying to create the deployment package using the InstallShield and also the installation prompts for a user name and a password for a service Log On account. I did not had ... ;t still confirm whether a issue is to do with a OS or it is specific to machine that I am trying to install it on.
asked Apr 25, 2020 stewart 4k points
0 votes
1 answer 5 views
5 views
Problem: Usually, I get this error: (The "service name" service on Local Computer started and then stopped.I don't know what keeps the windows service not starting, the windows form simulator worked fine. What seems to be the problem?
asked Mar 24 ummesalma 22.9k points
0 votes
1 answer 3 views
3 views
Problem: Any ideas on what I need to solve the error>error while delivering the message: serviceintent not found?
asked Apr 4 ashik 10.7k points
0 votes
1 answer 4 views
4 views
Problem: Can anyone tell me the solution of this problem that windows could not start the windows audio service on local computer?
asked Mar 18 Ifra 24.4k points
0 votes
1 answer 3 views
3 views
Problem: please help, I get the following message when I run my application: log4j:WARN No appenders could be found for logger (dao.hsqlmanager). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. What do these warnings mean? What's the appender here?
asked Mar 15 ummesalma 22.9k points