Dec 2, 2009

Installing Windows Service

Installing a windows ervice is as simple as running this code on a windows commmand prompt:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /u " myservice1.exe"

Note: The above line of code installs a service using .net framework 2.0 (choose yours) whose assembly is myservice1.exe.
If you are unsure what your assembly name is, just look into the bin/debug folder of your
windows service project and you will find the exe there.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe " myservice1.exe"

Note: The above line of code uninstalls a service using .net framework 2.0 (choose yours) whose assembly is myservice1.exe.

If you are unsure what your assembly name is, just look into the bin/debug folder of your windows service project and you will find the exe there.

Also the "myservice1.exe" must be the full path to your service exe unless you are running command from the same folder.

No comments:

Post a Comment