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. Changing code while debuging c# Application

Changing code while debuging c# Application

Scheduled Pinned Locked Moved C#
debuggingcsharpquestion
7 Posts 6 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.
  • I Offline
    I Offline
    idreesbadshah
    wrote on last edited by
    #1

    When i inser a break point and debug a c# programme i m unable to change the code in this mode(Debug Mode). I remeber previously i can change code in c# APplication.Has any body idea what reason may be ????? Why it is not allowing to change code while debugging.Now it gives follwing message on change of code "Changes are not allowed when debugger has been attached to an already running process or the code being debugged is optimized"

    A I B 3 Replies Last reply
    0
    • I idreesbadshah

      When i inser a break point and debug a c# programme i m unable to change the code in this mode(Debug Mode). I remeber previously i can change code in c# APplication.Has any body idea what reason may be ????? Why it is not allowing to change code while debugging.Now it gives follwing message on change of code "Changes are not allowed when debugger has been attached to an already running process or the code being debugged is optimized"

      A Offline
      A Offline
      anu81
      wrote on last edited by
      #2

      hi, As far as i know you can make changes to the code during runtime only in a web application. You cannot do it in a windows application. Thanks Regards Anuradha

      R 1 Reply Last reply
      0
      • I idreesbadshah

        When i inser a break point and debug a c# programme i m unable to change the code in this mode(Debug Mode). I remeber previously i can change code in c# APplication.Has any body idea what reason may be ????? Why it is not allowing to change code while debugging.Now it gives follwing message on change of code "Changes are not allowed when debugger has been attached to an already running process or the code being debugged is optimized"

        I Offline
        I Offline
        il_masacratore
        wrote on last edited by
        #3

        Are you sure that you can't? Even when the execution point is inside the same method where you want change code? ... But i think that is a dangerous practice... Sometimes when you change code often in debug mode applications behaviour change, or that's my experience. Because you change code, and seems that it don't applies changes... And when you're angry because you don't know where is the problem, you close VS, clean and rebuild your app and all is fine... That's my opinion... Have you suffered this?

        Visit my blog at http://dotnetforeveryone.blogspot.com/

        I 1 Reply Last reply
        0
        • I il_masacratore

          Are you sure that you can't? Even when the execution point is inside the same method where you want change code? ... But i think that is a dangerous practice... Sometimes when you change code often in debug mode applications behaviour change, or that's my experience. Because you change code, and seems that it don't applies changes... And when you're angry because you don't know where is the problem, you close VS, clean and rebuild your app and all is fine... That's my opinion... Have you suffered this?

          Visit my blog at http://dotnetforeveryone.blogspot.com/

          I Offline
          I Offline
          idreesbadshah
          wrote on last edited by
          #4

          Yes I M sure .I have told that i cannot change even within the same method .Dunot know whts happened to this application

          U 1 Reply Last reply
          0
          • I idreesbadshah

            When i inser a break point and debug a c# programme i m unable to change the code in this mode(Debug Mode). I remeber previously i can change code in c# APplication.Has any body idea what reason may be ????? Why it is not allowing to change code while debugging.Now it gives follwing message on change of code "Changes are not allowed when debugger has been attached to an already running process or the code being debugged is optimized"

            B Offline
            B Offline
            blackjack2150
            wrote on last edited by
            #5

            Is "Edit and Continue" enabled? (Tools->Options->Debugging->Edit and Continue)

            1 Reply Last reply
            0
            • I idreesbadshah

              Yes I M sure .I have told that i cannot change even within the same method .Dunot know whts happened to this application

              U Offline
              U Offline
              Urs Enzler
              wrote on last edited by
              #6

              You can, simply enable Edit And Continue as proposed in another post in the project options. Although it will only work if the process was started by the debugger and not if the debugger is attached to the process.

              -^-^-^-^-^- no risk no funk ................... please vote ------>

              1 Reply Last reply
              0
              • A anu81

                hi, As far as i know you can make changes to the code during runtime only in a web application. You cannot do it in a windows application. Thanks Regards Anuradha

                R Offline
                R Offline
                Russell Jones
                wrote on last edited by
                #7

                That's strange, edit and continue only ever works for me in a winforms application. It never works for me in web apps. You do need to make sure that you have "break all processes when one process breaks" checked (*This may or may not be the exact text) Russell

                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