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

windows service

Scheduled Pinned Locked Moved C#
databasecsharpvisual-studiosysadmindebugging
5 Posts 3 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
    Harikrk
    wrote on last edited by
    #1

    i have developed a windows service. This service updates a sql express database. On running the service, the service gets hang and the event viewer shows .sqlexpection. Is there any way i can debug an installed service. I dont have .net ide installed in the system where service is isntalled. More over the sql express database is in another system. Can you tell me what should be the connection string, if the server name is dev-sqlx and db name is report thanks and regards hari

    V 1 Reply Last reply
    0
    • H Harikrk

      i have developed a windows service. This service updates a sql express database. On running the service, the service gets hang and the event viewer shows .sqlexpection. Is there any way i can debug an installed service. I dont have .net ide installed in the system where service is isntalled. More over the sql express database is in another system. Can you tell me what should be the connection string, if the server name is dev-sqlx and db name is report thanks and regards hari

      V Offline
      V Offline
      Vikram A Punathambekar
      wrote on last edited by
      #2

      You'll likely have to introduce a Thread.Sleep() in the service code to give you enough time to attach your debugger to the process. I've never tried to debug a service remotely. You can google for the connection string.

      Cheers, Vikram.


      "If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy

      H 1 Reply Last reply
      0
      • V Vikram A Punathambekar

        You'll likely have to introduce a Thread.Sleep() in the service code to give you enough time to attach your debugger to the process. I've never tried to debug a service remotely. You can google for the connection string.

        Cheers, Vikram.


        "If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy

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

        i just want to activate the debugger before the service crashes.. is there any specific way in windows to activate this?

        L 1 Reply Last reply
        0
        • H Harikrk

          i just want to activate the debugger before the service crashes.. is there any specific way in windows to activate this?

          L Offline
          L Offline
          Le centriste
          wrote on last edited by
          #4

          Put a System.Diagnostics.Debugger.Launch() call in your code where you want the debugger to start.

          ----- You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies If atheism is a religion, then not collecting stamps is a hobby. -- Unknown God is the only being who, to rule, does not need to exist. -- Charles Baudelaire

          V 1 Reply Last reply
          0
          • L Le centriste

            Put a System.Diagnostics.Debugger.Launch() call in your code where you want the debugger to start.

            ----- You seem eager to impose your preference of preventing others from imposing their preferences on others. -- Red Stateler, Master of Circular Reasoning and other fallacies If atheism is a religion, then not collecting stamps is a hobby. -- Unknown God is the only being who, to rule, does not need to exist. -- Charles Baudelaire

            V Offline
            V Offline
            Vikram A Punathambekar
            wrote on last edited by
            #5

            I didn't know about this - will have to give it a try next time. Thanks :)

            Cheers, Vikram.


            "If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy

            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