TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rajeswari gaekwad
NA
55
12.4k
Windows Service code change not updating in the new build
Aug 23 2016 9:30 AM
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
Reply
Answers (
5
)
Oracle Job can run the windows service
Windows Service Application exe file not updating