Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
Windows Service code change not updating in the new build
rajeswari gaekwad
Aug 23 2016 9:30 AM
388
Reply
Hi,
I am having a windows service where I am programatically uninstalling it if previous version exists and installing the service.
The code to uninstall as below
private
void
ProjectInstaller_BeforeInstall(
object
sender, System.Configuration.Install.InstallEventArgs e)
{
List<ServiceController> services =
new
List<ServiceController>(ServiceController.GetServices());
foreach
(ServiceController s
in
services)
{
if
(s.ServiceName ==
this
.serviceInstaller1.ServiceName)
{
ServiceInstaller ServiceInstallerObj =
new
ServiceInstaller();
ServiceInstallerObj.Context =
new
System.Configuration.Install.InstallContext();
ServiceInstallerObj.Context = Context;
ServiceInstallerObj.ServiceName =
"SARWindowsService"
;
ServiceInstallerObj.Uninstall(
null
);
break
;
}
}
}
Now it do uninstall the service before installing the new build but the problem is
the code change i make doesnot reflect in the new build.
Can anyone help on this
Thanks
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Oracle Job can run the windows service
Windows Service Application exe file not updating