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. Windows Service dependency problem

Windows Service dependency problem

Scheduled Pinned Locked Moved C#
csharphardwaredata-structureshelpquestion
3 Posts 2 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.
  • H Offline
    H Offline
    halexic
    wrote on last edited by
    #1

    I have written a windows service that starts automaticaly on windows boot and it do some jobs. If I restart PC, or if I log off and then log on again my service is still started but is not working anymore. My service use another service that is written from another manufacturer (this service can open communications to some hardver devices and communicate with them). It seems that on booting my service starts before that service it depends on, so it is not working (I suppose that is because on starting my service call that custom service to open communication to devices and after restart or log off I lost these opened communications to hardware devices that are controlled by that custom service). How I can set that my windows service depends on this service? (I know the path of EXE file of that custom service and this service is listed in services.msc). I see in C# initialization of windows service array ServicesToRun - so how I can reference and load that service I depend on to load before my service)? I hope that it will resolve my problem...

    C 1 Reply Last reply
    0
    • H halexic

      I have written a windows service that starts automaticaly on windows boot and it do some jobs. If I restart PC, or if I log off and then log on again my service is still started but is not working anymore. My service use another service that is written from another manufacturer (this service can open communications to some hardver devices and communicate with them). It seems that on booting my service starts before that service it depends on, so it is not working (I suppose that is because on starting my service call that custom service to open communication to devices and after restart or log off I lost these opened communications to hardware devices that are controlled by that custom service). How I can set that my windows service depends on this service? (I know the path of EXE file of that custom service and this service is listed in services.msc). I see in C# initialization of windows service array ServicesToRun - so how I can reference and load that service I depend on to load before my service)? I hope that it will resolve my problem...

      C Offline
      C Offline
      ChrisAdams
      wrote on last edited by
      #2

      Within the Service Control Panel, you can set dependencies within the properties page. Window will only start your service after the dependency has started.

      H 1 Reply Last reply
      0
      • C ChrisAdams

        Within the Service Control Panel, you can set dependencies within the properties page. Window will only start your service after the dependency has started.

        H Offline
        H Offline
        halexic
        wrote on last edited by
        #3

        If I start services.msc and then right click on service, and then if I go to Dependencies tab I can just see the services that this service depend of. How I can add some service? Don't see any add, or on right mouse click... (Windows 2000 Professional)

        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