In your integration service project,
1. Edit ProjectInstaller.Designer.cs,
check if the Service Installer has been well configured
//
// serviceInstaller
//
this.serviceInstaller.ServiceName = "<default service name>";
this.serviceInstaller.DisplayName = "<default service display name>";
this.serviceInstaller.Description = "<service description>";
this.serviceInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
2. Edit ProjectInstaller.cs
Add the following codeto the constructor, after InitializeComponent()
InitializeComponent();
//add code here
var config = System.Configuration.ConfigurationManager.OpenExeConfiguration(
System.Reflection.Assembly.GetAssembly(
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)
.Location);
var serviceNameSetting = config.AppSettings.Settings["ServiceName"];
if (serviceNameSetting != null)
{
this.serviceInstaller.ServiceName = serviceNameSetting.Value;
}
var serviceDisplayNameSetting = config.AppSettings.Settings["ServiceDisplayName"];
if (serviceDisplayNameSetting != null)
{
this.serviceInstaller.DisplayName = serviceDisplayNameSetting.Value;
}
3 add the following settings to App.config
`
<add key="ServiceName" value="<serviceName>.<Dev|UAT|QA>"/>
<add key="ServiceDisplayName" value="<serviceDisplayName>.<Dev|UAT|QA>"/>
4. Build your integration service project in Release mode
On the Target server
5. RDP to server, copy service dlls to there
6. Start cmd as Administrator
7. cd /d <service bits folder on server>
8. install service: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe<yourService.exe>
9. uninstall service: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe/u <yourService.exe>