installutil

Install Windows Service created in Visual Studio

守給你的承諾、 提交于 2019-11-26 17:56:16
问题 When I create a new Windows Service in Visual Studio 2010, I get the message stating to use InstallUtil and net start to run the service. I have tried the following steps: Create new project File -> New -> Project -> Windows Service Project Name: TestService Build project as is (Service1 constructor, OnStart, OnStop) Open command prompt, run "C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" TestService.exe Run net start TestService . Output of step 4 Running a transacted

Install a .NET windows service without InstallUtil.exe

北慕城南 提交于 2019-11-26 12:35:51
I have a standard .NET windows service written in C#. Can it install itself without using InstallUtil? Should I use the service installer class? How should I use it? I want to be able to call the following: MyService.exe -install And it will have the same effect as calling: InstallUtil MyService.exe Marc Gravell Yes, that is fully possible (i.e. I do exactly this); you just need to reference the right dll (System.ServiceProcess.dll) and add an installer class... Here's an example: [RunInstaller(true)] public sealed class MyServiceInstallerProcess : ServiceProcessInstaller { public

Install a .NET windows service without InstallUtil.exe

雨燕双飞 提交于 2019-11-26 03:36:32
问题 I have a standard .NET windows service written in C#. Can it install itself without using InstallUtil? Should I use the service installer class? How should I use it? I want to be able to call the following: MyService.exe -install And it will have the same effect as calling: InstallUtil MyService.exe 回答1: Yes, that is fully possible (i.e. I do exactly this); you just need to reference the right dll (System.ServiceProcess.dll) and add an installer class... Here's an example: [RunInstaller(true)