Are you running Prompt as an administrator?
If it is windows 8 I suggest you try to do the same operation in a window 7.
However I already had some problems with installutil.exe... so I do the following::
Add the reference System.Configuration.Install
at your service in visual studio.
In Main.Cs or Program.Cs (depends on your application) enter the following code:
static void Main(string[] args)
{
if (Environment.UserInteractive)
{
string parameter = string.Concat(args);
switch (parameter)
{
case "--install":
ManagedInstallerClass.InstallHelper(new[] { Assembly.GetExecutingAssembly().Location });
break;
case "--uninstall":
ManagedInstallerClass.InstallHelper(new[] { "/u", Assembly.GetExecutingAssembly().Location });
break;
}
}
else
{
//aqui é seu codigo para rodar o serviço normalmente.
ServiceBase[] servicesToRun = new ServiceBase[]
{
new ValidatorService()
};
ServiceBase.Run(servicesToRun);
}
}
Now Voce only calls in cmd the generated program: Servico.exe with the --install argument to install the service...to give up using --Uninstall.
And now you can throw away the installutil.exe
Take a look at this: [Ask]
– Marciano.Andrade
I did a lot of research.. all the answers I found didn’t work and some of them took to use install Shield and for Visual Studio 14 install Shield doesn’t work. Now I’m not a great visual studio connoisseur come ask here...
– Gustavo Castilho
You can edit your question by placing the content of
InstallLog
, please?– Leonel Sanches da Silva