visual studio edit and continue does not work

brtb picture brtb · Aug 16, 2013 · Viewed 26.8k times · Source

In my project which is a hybrid project (in previous it was a web forms project that then we modified to use mvc pattern).

Now I want that in debug mode, I want to change something in my cs file, and then I want the changed code to run.

I've tried enabling and disabling tools -> options -> debug -> edit and continue checkbox part.

When it is enabled I can't change code in my project while debugging. When it is disabled I can change code but it does not affect on running part. for example.

  int i = 0;
  if(i == 1)
    return 1;
  else
    return 2;

In debug mode I changed i to 1 but it stil returned 2, in the following code, only when I stop and re-run the debugger it takes affects.

 int i = 1;
  if(i == 1)
    return 1;
  else
    return 2;

BTW I am using Visual Studio 2010 version.

Answer

James Joyce picture James Joyce · Aug 21, 2017

This wasn't my problem; running VS2017 RC2, I found that under Tools -> Options -> Debugging -> Just-In-Time - my "Managed Code" was deselected.

There was a warning "Another debugger has registered itself as the Just-In-Time debugger. Fix by enabling Just-In-Time debugging or running Visual Studio repair".

I had not registered any other debugging tools! So no idea why it unticked...

So the fix was simply to tick the "Managed" box....