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 in c#

windows service in c#

Scheduled Pinned Locked Moved C#
csharpsecurityxmlhelpquestion
2 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.
  • O Offline
    O Offline
    omkamal
    wrote on last edited by
    #1

    Oh! This is driving me X|. I have a windows service written in C# and .NET. All it has to do is write an xml document based on the information found in the system, for every 5 seconds. So I have a timer and a GetInfo function. This function is called by the Elapsed event of the timer (every 5 secs). And I have included everything in try...catch block. In my catch block, I catch any exception thrown and store in EventLog. I am getting a lot of problems. 1. The service is not starting. When I start it using the Services Manager, it will attempt to start and end up saying "Service could not be started in a timely fashion". 2. In some test machines it starts although, its not writing any xml nor any EventLog Exception entry. I checked my code thoroughly and is just working ducky in my development machine. Is there some security issue that I need to consider while running this service? (I am running the service as LocalSystem account). How would this affect accessing Eventlog or writing an xml doc...??? Any suggestions/.. omkamal

    L 1 Reply Last reply
    0
    • O omkamal

      Oh! This is driving me X|. I have a windows service written in C# and .NET. All it has to do is write an xml document based on the information found in the system, for every 5 seconds. So I have a timer and a GetInfo function. This function is called by the Elapsed event of the timer (every 5 secs). And I have included everything in try...catch block. In my catch block, I catch any exception thrown and store in EventLog. I am getting a lot of problems. 1. The service is not starting. When I start it using the Services Manager, it will attempt to start and end up saying "Service could not be started in a timely fashion". 2. In some test machines it starts although, its not writing any xml nor any EventLog Exception entry. I checked my code thoroughly and is just working ducky in my development machine. Is there some security issue that I need to consider while running this service? (I am running the service as LocalSystem account). How would this affect accessing Eventlog or writing an xml doc...??? Any suggestions/.. omkamal

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi omkamal: Well i am running thru the same scenerio my friend. I am logged in as Local Admin on my win 2000 prof box and installed a .net C# service as LocalSystem account. When I try to start the service it hangs on and gives me that standard error, that is, "Service could not be started in a timely fashion". What all things do u need to take care or what are the prerequisites for a successful service install and start up? I even tried creating a basic service and tried starting it but gave me the same stupid error message!! Thanks, Rakesh

      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