how to install and debug windows service developed in c#.net 2008 ?

how to install and debug windows service developed in c#.net 2008 ?

(installutil is not working !! )
Ameerh24Asked:
Who is Participating?
 
angus_young_acdcCommented:
Have you also been sure to add an Installer Class to your project?  As that is required for the installation, with code similar to the following in it (name the strings to whatever you require.
Then simply follow the following instructions:
Click Start -> Visual Studio [Version] -> Visual Studio Tools then select Visual Studio [Version] Command Prompt, from here just type:

installutil.exe then the full path to your exe.  Eg:

installutil.exe "C:\MyApp\MyApp.exe"

That will install it.  Alternatively, you can create an MSI with a custom action to install your service, this would use the install class that you add in your project.

ServiceInstaller si = new ServiceInstaller();
            ServiceProcessInstaller spi = new ServiceProcessInstaller();

            si.ServiceName = "";
            si.DisplayName = "";
            si.Description = "";
            si.StartType = ServiceStartMode.Automatic;
            this.Installers.Add(si);

            spi.Account = System.ServiceProcess.ServiceAccount.User;
            spi.Password = null;
            spi.Username = null;
            this.Installers.Add(spi);

Open in new window

0
 
CsharpCommented:
what error message you are getting (installutill is not working).
can you explain the exact situation
 
0
 
swapneel_d14Commented:
why installutil   is not working???
0
 
Ameerh24Author Commented:
Solution Works Fine
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.