locked
Windows service doesn't show as started RRS feed

  • Question

  • I have a tcp server implemented as a windows service.  It installs fine, seems to work fine, but doesn't show as "Started".  It's set on automatic startup, and it seems to start automatically, but it doesn't show "Started" next to the service's name.  If I right click on it and go to properties, it shows that the service status is started and in fact it is working, so why doesn't it show as started in the services list???  If I stop it and then start it, it shows as started in the list, so why doesn't it on initial startup???  Any ideas???
    • Moved by Paul Zhou Thursday, November 3, 2011 5:55 AM off-topic (From:.NET Base Class Library)
    Monday, October 31, 2011 1:35 PM

Answers

  • If a service is started it shows started under the status column and when you right click on the service the option to start is disabled. Only stop option is available to click. Wanted to know what's available in your case. If Start is active, then your services isn't turning up, but incase if its not then it might be a bug
    Mark Answered, if it solves your question
    Rohit Arora
    Tuesday, November 1, 2011 5:36 AM
  • It seems that it is a issue about Windows 7. The issue is off-topic in this forum BCL:Discuss the Base Class Library, design, and best practice issues of managed code: Collections, Diagnostics, I/O, Registry, Globalization, Reflection, and Text. 

    You can post thread in Windows 7 IT Pro forum to get better support.

    Have a nice day.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, November 2, 2011 6:07 AM

All replies

  • No idea.  Sounds more like an OS bug than a service bug, since you say that the Properties window show it as Started.  The fact that the Properties window says one thing while the list of services says another doesn't make much sense to me.

    Just to be sure:  Did you follow the appropriate guidelines to implement this service?  Are you returning an answer to the Service Manager as soon as possible?


    Jose R. MCP
    Monday, October 31, 2011 1:43 PM
  • What/where are the appropriate guidelines.  I have the OnStart() method spawn a separate thread for the TCP Server (because it's an endless loop) and the OnStart() method returns immediately.  OnStart is void, so there's nothing to return.  Note too that if I stop and then start the service it shows properly in the list (as started).
    Monday, October 31, 2011 2:22 PM
  • See this topic:  http://msdn.microsoft.com/en-us/library/windows/desktop/ms685967(v=VS.85).aspx.  It is for programming services in C/C++, but all recommendations there apply to any and all services.  Of course, much of this is encapsulated by the ServiceBase class in .Net, but it is still good reading if you are serious about programming Windows services.
    Jose R. MCP
    Monday, October 31, 2011 2:40 PM
  • The scenario I described above was on my Windows 7 machine.  I installed the same service on a Windows Server 2008 machine and it works perfectly -- shows "Started" on initial startup.  Interesting... 
    Monday, October 31, 2011 4:11 PM
  • If a service is started it shows started under the status column and when you right click on the service the option to start is disabled. Only stop option is available to click. Wanted to know what's available in your case. If Start is active, then your services isn't turning up, but incase if its not then it might be a bug
    Mark Answered, if it solves your question
    Rohit Arora
    Tuesday, November 1, 2011 5:36 AM
  • It seems that it is a issue about Windows 7. The issue is off-topic in this forum BCL:Discuss the Base Class Library, design, and best practice issues of managed code: Collections, Diagnostics, I/O, Registry, Globalization, Reflection, and Text. 

    You can post thread in Windows 7 IT Pro forum to get better support.

    Have a nice day.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, November 2, 2011 6:07 AM