Javascript required
Skip to content Skip to sidebar Skip to footer

Visual Studio C Edit and Continue Debug 2010

3 Answers 3

According to http://connect.microsoft.com/VisualStudio/feedback/details/520179/vs2010-sp2-x86-unable-to-edit-and-continue Edit and Continue is supposed to be possible in ASP.NET projects with Visual Studio 2010, but only while you are stopped at a breakpoint.

Here are the steps from the Microsoft answer there to make sure Edit and Continue is turned on, and to see if it's working for you:

  1. File > New Project, select C#, create a new Web Application
  2. Go into the Default.aspx.cs file
  3. Put a breakpoint at the Page_Load function
  4. Open project properties, choose the Web tab, select "Enable Edit and Continue", hit save, close the property pages
  5. Hit F5 on your Default.aspx
  6. When the breakpoint is hit, try to create a new variable inside the Page_Load function by writing the following lines of code:

    int i = 1; i += 5;

  7. Hit F10 (or hit step into)

  8. See the new code get hit, you can hover over variables to get their values.

answered May 26, 2011 at 12:55

Kate Gregory's user avatar

7

  • Any idea on how we can achieve this in Windows application

    May 26, 2011 at 13:00

  • @satyajit Tools, Options,Debugging, Edit and Continue, make sure Edit and Continue is checked, you're all set.

    May 26, 2011 at 13:08

  • @kate-gregory then also its not helping for windows solution

    May 27, 2011 at 4:32

  • @satyajit ask a separate question about your windows app, keep this one about the web one

    May 27, 2011 at 10:45

  • I had checked "Tools > Options > Debugging > Enable Edit & Continue", but in my case what did it was going into "Project > Web" and checking "Enable Edit and Continue". I didn't know i had to turn it on in the project too. Thanks!

    Nov 15, 2012 at 15:51

I was getting this in Visual Studio 2010 while working on a C# project remotely.

The key here is: Tools -> Options -> Debugging -> Edit and Continue -> 'Enable while remote debugging or running under another user name' at the bottom.

answered Feb 11, 2013 at 21:58

fIwJlxSzApHEZIl's user avatar

VS2010 has a nice error message that says:

Changes are not allowed while code is running or if the option 'Break all processes when one process breaks' is disabled. The option can be enabled in Tools, Options, Debugging.

Changes are not allowed while code is running is pretty clear. The reason for this is that your code needs to be compiled before running. To make any changes you need to stop execution, make your change and recompile the code again.

If you want to run ad hoc code to check variables etc. use the "QuickWatch" option in your context menu, or the "Immediate" window.

answered May 26, 2011 at 12:53

tobias86's user avatar

5

  • actually "While code is running" means "while you are not at a breakpoint"

    May 26, 2011 at 12:55

  • Indeed. There could be background threads running concurrently that are trying to access data you would then be editing in the editor by either things such as the immediate window or by just clicking the variable and modifying its value.

    Feb 11, 2013 at 21:57

  • I just wish it would allow me to edit the code now and continue to run on the old code. This way I can make a number of modifications during the debug session without having to stop and restart. I don't care if the break points become slightly off by a line or two.

    Jul 25, 2013 at 8:08

  • All I want is for the @#$%^ IDE to stop debugging. I've been using VS for over a decade and continue to run into the idiotic dialog "Changes not allowed to 64 bit applications" with nothing but an OK option to clear the dialog. This is not helpful. It is a waste of time.

    Oct 15, 2013 at 20:44

  • In VS2013, disabling Edit & Continue gets rid of this annoying dialog and allows you to make edits. Bizarre.

    Feb 5, 2014 at 1:58

kingstongreste1991.blogspot.com

Source: https://stackoverflow.com/questions/6138723/modifying-the-code-while-debugging-in-vs-2010