Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Trouble installing Windows Service on different computer

Trouble installing Windows Service on different computer

Scheduled Pinned Locked Moved C#
csharphelpvisual-studioworkspace
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shven47
    wrote on last edited by
    #1

    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

    N D 2 Replies Last reply
    0
    • S Shven47

      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

      N Offline
      N Offline
      Nissim Salomon
      wrote on last edited by
      #2

      Hi I suggest to install the service manually in order to understand if the problem cause by the installation program

      1 Reply Last reply
      0
      • S Shven47

        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

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • D Dave Kreskowiak

          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

          S Offline
          S Offline
          Shven47
          wrote on last edited by
          #4

          Hello 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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups