Visual Studio Edit and Continue Greyed Out

[

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.

,

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….

,

None of the given answers worked. Here's what I did.

  • I repaired the VS installation. I had 2017 version.
  • I unticked the Native code checkbox.

enter image description here

,

None of the above worked for me on their own, but once I unchecked "Enable Native Edit and Continue" then it worked: under Tools -> Options -> Debugging -> General.

enter image description here

,

  1. Under Tools -> Options -> Debugging -> General: Check the box for 'Enable Edit and Continue'.
  2. Under Tools -> Options -> Debugging -> Just-In-Time: Check the box for 'Managed Code' Image Checking Managed Code
  3. Save and restart Visual Studio. If you get a warning about elevated permissions, accept the dialog. Your changes are not saved yet. After restart, go again to Tools -> Options -> Debugging -> Just-In-Time: Check the box for 'Managed Code' if not showing checked. Save and restart Visual Studio.

,

The solution of this problem is on the Microsoft Documentation… After you enable tools-> options -> debud -> edit and continue…. There is more to do..

If IntelliTrace is enabled and you collect both IntelliTrace events and call information, Edit and Continue is disabled.

On Visual studios' menu go on Tools>>options – Select "IntelliTrace" tab and let IntelliTrace events only checked.. Save, restart the visual studio and…….

Your Edit and Continue will work again!

,

I discovered that my

              VS2019: Project (context menu) => Properties => Debug => Debugger engines => Enable native code debugging                          

was turned on. After unchecking this my "Edit and Continue" issues disappeared!

Note: I had tried suggested fixes (here) prior to this discovery.

,

Edit & Continue doesn't work – this has fixed it for me – it's for VS2017 and started happening recently (March 2019).
It seems like NCover sets the system variable COR_ENABLE_PROFILING=1. Uninstalling it gets rid of it for me.

,

Repairing the VS installation, and upgrading to the current latest VS2017 version: 15.9.19 fixed the issue for me.

h-rai's answer gave me the clues I needed: unchecking the Native checkbox made a warning appear stating that another JIT debugger was registered.

Then, I found more clues in this article here

Perhaps, my issues were caused by having installed the new .NET core 3.1, but not having upgraded VS2017 to VS2019 yet.

Now, when I uncheck the "Native" checkbox, I do not get the warning about another JIT debugger, and I can modify code while debugging once again.

,

Before that, the Runtime Compilation was enabled by-default. For projects targeting .NET Core 3.0+ users need to explicitly enable that behavior by following the instructions https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?view=aspnetcore-3.0

install from Nuget package manager Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation

Run the below command:
Install-Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -Version 5.0.7
and add below line in Startup file

services.AddRazorPages().AddRazorRuntimeCompilation();

,

If you've already updated Debug options but Edit&Continue still doesn't work, try cleaning and rebuilding the project. (worked for me in VS 2022)

,

Just press the Break All button, then edit your code, then press Continue.
It is work for me like a charm

enter image description here

]

dillardficust.blogspot.com

Source: https://codeutility.org/debugging-visual-studio-edit-and-continue-does-not-work-stack-overflow/

0 Response to "Visual Studio Edit and Continue Greyed Out"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel