Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a window servcie. Currenlty its running on my local server.

Now i have some new requirement and i modified the service code.Now I have new EXE file for the servcie.I want to use that exe file for the window servcie that is already running.

So for that I just stop the running servcie and then replace the existing EXE file with new modified exe file. And then start the servcie.

So my question is, IS it the right way to used modified exe in windows servcie without uninstalling the servcie? and also is it working fine or Not?

Also suggest me the proper working solution.

Thanks
Posted

Yes, as long as the service name stays the same that is what you have to do.

If you want to be more adventurous you can create a DLL for your functionality and a simple loader (through reflection) and have the loader copy an update file if it exists on a restart. That way the process is automated and as simple as a service restart.
 
Share this answer
 
We should uninstall and reinstall the service.
We can do that manually from the Programs and Defaults window (just search for that). Or we can create a service installer that uninstalls the previous version automatically and call that from a .bat file or from the command line.

See all these options in this blog post: http://candordeveloper.com/2012/12/28/simple-installer-for-windows-service-using-visual-studio-2012/
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900