Trouble installing Windows Service on different computer
-
I have created a windows service that runs a timer which checks the time on the local computer, and at a certain time, it will call a webservice I have created. It runs beautifully on the computer that I developed it on, but when I try to install and run it on a different computer, it stops immediately with the error message "The service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs." I am not sure if it is a rights thing, or if I am missing something when I created the installer and setup files. The windows service is written in C#, and so is the web service it calls. It also writes to the event log, and i am not sure it that would have an affect. Things I have tried: 1. created a setup project in Visual Studio to install the service. 2. moved the project to the remote computer to build it and try to install it using the installutil program. 3. tried another computer in addition to the first remote computer I know it is possible, and I am sure I am just missing something. Any help would be greatly appreciated. Thanks, heather
-
I have created a windows service that runs a timer which checks the time on the local computer, and at a certain time, it will call a webservice I have created. It runs beautifully on the computer that I developed it on, but when I try to install and run it on a different computer, it stops immediately with the error message "The service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs." I am not sure if it is a rights thing, or if I am missing something when I created the installer and setup files. The windows service is written in C#, and so is the web service it calls. It also writes to the event log, and i am not sure it that would have an affect. Things I have tried: 1. created a setup project in Visual Studio to install the service. 2. moved the project to the remote computer to build it and try to install it using the installutil program. 3. tried another computer in addition to the first remote computer I know it is possible, and I am sure I am just missing something. Any help would be greatly appreciated. Thanks, heather
Hi I suggest to install the service manually in order to understand if the problem cause by the installation program
-
I have created a windows service that runs a timer which checks the time on the local computer, and at a certain time, it will call a webservice I have created. It runs beautifully on the computer that I developed it on, but when I try to install and run it on a different computer, it stops immediately with the error message "The service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs." I am not sure if it is a rights thing, or if I am missing something when I created the installer and setup files. The windows service is written in C#, and so is the web service it calls. It also writes to the event log, and i am not sure it that would have an affect. Things I have tried: 1. created a setup project in Visual Studio to install the service. 2. moved the project to the remote computer to build it and try to install it using the installutil program. 3. tried another computer in addition to the first remote computer I know it is possible, and I am sure I am just missing something. Any help would be greatly appreciated. Thanks, heather
Your service is written incorrectly. It sounds like you started a Timer in the OnStart handler to run the service. The is not a good idea. Normally, services are expected to start a seperate thread that runs code that does the service work.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Your service is written incorrectly. It sounds like you started a Timer in the OnStart handler to run the service. The is not a good idea. Normally, services are expected to start a seperate thread that runs code that does the service work.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Hello Dave. Thank you for the information. I am new to this, and this is the first time I have written a windows service. I have a function that initializes the timer, and I have it set to run in the Onstart handler of the service. I put it in the service so it would start back even if the computer rebooted unexpectedly. How can I modify it to start a separate thread? I am not very familiar with threads yet either. Thanks again, Heather