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. Web Development
  3. ASP.NET
  4. Static values keeping their instance after stopping the debugger

Static values keeping their instance after stopping the debugger

Scheduled Pinned Locked Moved ASP.NET
debuggingcsharpsysadminquestion
4 Posts 2 Posters 1 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.
  • B Offline
    B Offline
    Brendan Vogt
    wrote on last edited by
    #1

    Hi, I am debugging through a web application that was written in C#. When the app loads it gets some values using static methods. Whenever I stop the debugging and run it again then it doesn't go into these static methods again as they are static. I want to kill this static variable instance so that I can debug through these methods again. I have stopped the web server in VS2010, but it doesn't work. I hope I am making sense? :) Thanks

    T 1 Reply Last reply
    0
    • B Brendan Vogt

      Hi, I am debugging through a web application that was written in C#. When the app loads it gets some values using static methods. Whenever I stop the debugging and run it again then it doesn't go into these static methods again as they are static. I want to kill this static variable instance so that I can debug through these methods again. I have stopped the web server in VS2010, but it doesn't work. I hope I am making sense? :) Thanks

      T Offline
      T Offline
      T M Gray
      wrote on last edited by
      #2

      That isn't what static methods mean. Static means that they do not rely on an instance of the object. If you call the method it will be executed every time it is called. If you aren't hitting your breakpoints in the static method then something else is going wrong.

      B 1 Reply Last reply
      0
      • T T M Gray

        That isn't what static methods mean. Static means that they do not rely on an instance of the object. If you call the method it will be executed every time it is called. If you aren't hitting your breakpoints in the static method then something else is going wrong.

        B Offline
        B Offline
        Brendan Vogt
        wrote on last edited by
        #3

        Thanks for the reply. I'm actually testing a singleton that was written to retrieve global values. It's the first time I am working with singleton so I am debugging to see how it works. The first time I ran it I got the instance of the singleton object, then I stopped it. I ran it again, and it doesn't go into the property where it returns the singleton's instance. I am using VS2010. Thanks

        T 1 Reply Last reply
        0
        • B Brendan Vogt

          Thanks for the reply. I'm actually testing a singleton that was written to retrieve global values. It's the first time I am working with singleton so I am debugging to see how it works. The first time I ran it I got the instance of the singleton object, then I stopped it. I ran it again, and it doesn't go into the property where it returns the singleton's instance. I am using VS2010. Thanks

          T Offline
          T Offline
          T M Gray
          wrote on last edited by
          #4

          Too many pronouns. When you ran "it", is "it" an exe, a method? If "it" is a method I would not expect a singlton to run the code to create an instance more than once. That is what makes something a singleton. Your description of the situation is far too vague to really give you any concrete answers.

          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