CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Posts
    93

    Code update not working

    Hi,
    I have C# windows form project in VS-2008. It is fine when I run it in debug mode for the first time. Next time onwards, the program does not hit break points and any code update does not reflect in the new form being shown. Even if I comment certain lines of code, the program runs as in the way prior to editing the code.

    Then I found that the same is the case with any new project I create.
    I am lost.

    Could any one please help me?

  2. #2
    Join Date
    Dec 2008
    Posts
    144

    Re: Code update not working


  3. #3
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: Code update not working

    I have a query on similar lines - i am not able to edit my code when i run my program in debug mode.. only when i hit the break point in the code it am able to edit the code but not always .. ?
    how to make edit the code at all the times? any idea how to change the settings?

  4. #4
    Join Date
    Dec 2008
    Posts
    144

    Re: Code update not working

    Quote Originally Posted by vcdebugger View Post
    I have a query on similar lines - i am not able to edit my code when i run my program in debug mode.. only when i hit the break point in the code it am able to edit the code but not always .. ?
    how to make edit the code at all the times? any idea how to change the settings?
    Why do you want to edit your code while an application is running? Does it really need?

  5. #5
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Code update not working

    Quote Originally Posted by vcdebugger View Post
    I have a query on similar lines - i am not able to edit my code when i run my program in debug mode.. only when i hit the break point in the code it am able to edit the code but not always .. ?
    how to make edit the code at all the times? any idea how to change the settings?
    No, that won't work

    If that was possible, you'd never be able to run your project, as it keeps on changing, and then needs to be built again after each change This feature wasn't even available in VS 2003 and before, only since 2005, it came back so that we can edit the code in debug mode.

  6. #6
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: Code update not working

    Quote Originally Posted by Nikitozz View Post
    Why do you want to edit your code while an application is running? Does it really need?
    yup, when you run your application and observe that somethings are not running as per your expectation you think of changing the code , but you are not able to edit the code at this point of time - then you need to close your application and then change ytou code and then do a build.

    but suppose think if you hit a break point in your code and it allows you to edit the code and when you do F10( Next step-in) it wont close your application but it will Apply the code changes then and there itself and this saves lot of over head of closing your application and running once again.
    so what my doubt is if it allows you to edit your code when you hit a break point why not other times ? and also this feature helpd you if your application is huge and has lot of features which you wont remember when you close you application.. but by seeing your application running you are very much keen on the code changes...

  7. #7
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: Code update not working

    Quote Originally Posted by HanneSThEGreaT View Post
    No, that won't work

    If that was possible, you'd never be able to run your project, as it keeps on changing, and then needs to be built again after each change .
    hmmm.. currently i am using VS.NET 2008 version, in this if i make changes to code during debug mode when it hits a break point and when i say F10( step next) it does not close the application and builds fresh but i applys the code changes from where it was and process further with the code execution..

    Quote Originally Posted by HanneSThEGreaT View Post
    This feature wasn't even available in VS 2003 and before, only since 2005, it came back so that we can edit the code in debug mode.
    hmm.. I still remember that it was possible to change the code in Visual Studio 6.0 ( VC++ ) compiler ( not the VS.NET studio) during 2001-2002 time..... not 100 % sure though ;-)

  8. #8
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Code update not working

    Quote Originally Posted by vcdebugger View Post
    hmmm.. currently i am using VS.NET 2008 version, in this if i make changes to code during debug mode when it hits a break point and when i say F10( step next) it does not close the application and builds fresh but i applys the code changes from where it was and process further with the code execution..
    And that is how it should work, as I said. You must be in Break mode inorder to make changes. How you phrased your question gave me the impression you want to be able to type and build the whole time from anywhere

    The only ways you can build your program is by clicking the Build command etc., or in debug mode. If you try to make changes to a running program, it will not work otherwise

    Quote Originally Posted by vcdebugger View Post
    hmm.. I still remember that it was possible to change the code in Visual Studio 6.0 ( VC++ ) compiler ( not the VS.NET studio) during 2001-2002 time..... not 100 % sure though ;-)
    Yes, it was indeed possible with VC++ 6, I know, even with VB 6. But for some strange reason, that feature was only implemented in .NET from 2005 onwards

  9. #9
    Join Date
    Aug 2006
    Posts
    93

    Re: Code update not working

    Quote Originally Posted by Nikitozz View Post
    Thanks....
    but actually the problem was that there was an error in the code, which was not being attended to. I had earlier set that the code should run even if there is an error..... I changed it and things are OK now.... Thanks for the responses....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured