Windows service only gets called when visual studio is attached to a process

Răspuns Windows service only gets called when visual studio is attached to a process

  • viernes, 13 de abril de 2012 13:07
     
     

    I am struggling to know where to post this, I put it in Visual Studio Debugger as that is what I am trying to do, debug the process which is VB.Net based but was told it was the wrong forum.

    Any help would be greatly appreciated. 

    I am having problems with a windows service we have built within Windows 7 x64. It does not work correctly normally, however when I "Attached To Process" within Visual Studio it works as expected. I am using vb.net and I have tried disabling the firewall with no luck. 

    Are there some specific permissions that I need to allow the service to be called?

    Thanks in advance


    Katie Smith Systems Developer Bakkavor IS Development

Todas las respuestas

  • viernes, 13 de abril de 2012 13:48
     
     
  • viernes, 13 de abril de 2012 14:13
     
     

    Hi Purvi

    Thanks for the link but unfortunately it's not quite what I'm looking for, this shows how to debug a service in visual studio. I am able to do this using Visual Studio by using the "Attach To Process" tool. However my problem is, when the service is running normally (without debugging) it isn't working, something isn't firing. But when I am running the service with the debugging, it does work. 

    So it would seem something isn't firing when it is running by itself.

    Thanks for your response


    Katie Smith Systems Developer Bakkavor IS Development

  • viernes, 13 de abril de 2012 21:58
    Moderador
     
     Respondida

    Try to attach non-invasive debugger like windbg. Or collect dumps for your service and see what is going on (you may need to add special in-memory logging).

    -Karel

  • domingo, 15 de abril de 2012 7:54
     
     

    Hi Company Developer,

    1) Please make sure that you have installed your windows service correctly.

    2) Try to run your service under local system (because it has full privileges as Admin account has).

    3) If your service is using any system resources like file then you have to give permission to that resource explicitly.

    Please try all above steps, and check if it works.


    Regards, http://shwetamannjain.blogspot.com

    • Propuesto como respuesta Shweta Jain domingo, 15 de abril de 2012 7:54
    • Votado como útil Company Developer martes, 17 de abril de 2012 7:46
    •  
  • lunes, 16 de abril de 2012 8:10
     
     

    Hi Shweta

    Thanks for your response. I tried each of your steps and unfortunately still came out with the same result. It is quite difficult as it is a bespoke system and the service had been developed by us. 

    However, if it helps, an error I am getting is "Failed to reset desktop process".

    Thanks again for your help!


    Katie Smith Systems Developer Bakkavor IS Development

  • lunes, 16 de abril de 2012 8:10
     
     

    Hi Karel

    I will give your suggestion a try. Thanks!


    Katie Smith Systems Developer Bakkavor IS Development