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. .NET (Core and Framework)
  4. Debug Windows service

Debug Windows service

Scheduled Pinned Locked Moved .NET (Core and Framework)
debugginghelptutorial
4 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.
  • S Offline
    S Offline
    Sundeep Ganiga
    wrote on last edited by
    #1

    Hi to all, I have created a windows service which contains Timer control.The Service is being created and running well.I want to debug the code line by line of the service due to some malfunctioning.can any body help me regarding this.Can anybody tell how to debug the code.Hope that there will be someone to help me. Thanks Before answering, S G

    M 1 Reply Last reply
    0
    • S Sundeep Ganiga

      Hi to all, I have created a windows service which contains Timer control.The Service is being created and running well.I want to debug the code line by line of the service due to some malfunctioning.can any body help me regarding this.Can anybody tell how to debug the code.Hope that there will be someone to help me. Thanks Before answering, S G

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Build the application for debugging. Make sure the deployed location of the service application .EXE has the application's debug info file (.PDB) there too. In Visual Studio, go to the Debug menu and choose "Attach to Process...". Adjust the settings in the dialog as necessary and find your running service process in the list of processes. Then click the Attach button. If you do this with the service application project loaded in VS, you can open source files and set breakpoints, or whatever other usual debugging stuff you want to do.

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      S 1 Reply Last reply
      0
      • M Mark Salsbery

        Build the application for debugging. Make sure the deployed location of the service application .EXE has the application's debug info file (.PDB) there too. In Visual Studio, go to the Debug menu and choose "Attach to Process...". Adjust the settings in the dialog as necessary and find your running service process in the list of processes. Then click the Attach button. If you do this with the service application project loaded in VS, you can open source files and set breakpoints, or whatever other usual debugging stuff you want to do.

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        S Offline
        S Offline
        Sundeep Ganiga
        wrote on last edited by
        #3

        Mark, I tried this option, but faced some difficulties with no result. a)Once when i attach that process to my IDE with being set break points at some places,I see something getting debugged(running) in the application,but no stop at that break points. Can u please tell me in detail,how to debug,it will be good enough(PLEASE). I am using VS 2005. Thank u For replying, S G

        M 1 Reply Last reply
        0
        • S Sundeep Ganiga

          Mark, I tried this option, but faced some difficulties with no result. a)Once when i attach that process to my IDE with being set break points at some places,I see something getting debugged(running) in the application,but no stop at that break points. Can u please tell me in detail,how to debug,it will be good enough(PLEASE). I am using VS 2005. Thank u For replying, S G

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          S G 1986 wrote:

          Can u please tell me in detail,how to debug

          I'm not sure what else I can tell you. Those are the steps. Did you put breakpoints on code that has already run when the service started? Once you've attached the debugger to the process, go to the service control manager plugin and stop the service. Does the app stop in the debugger? If not then you haven't attached to the right process. If it does stop the debugger then we can narrow down the problem...

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          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