Edit and Continue: “Changes are not allowed when…”

Other Applicable Solutions:

Below is an incomplete, unordered list of possible solutions to try if you* are trying to fix Edit & Continue quickly.

  • Make sure you are in Debug Mode

  • Make sure you’re not launching a mixed mode process

  • Try to set the CPU target to x86 rather than AnyCPU (on x64 machines)

  • Uncheck the Optimize Code checkbox for Debug Mode in Project Properties->Debug

  • Uncheck the Optimize Code checkbox in Project Properties->Build

  • Uncheck Enable Optimizations in Advanced Compiler Settings

  • (ASP.NET) Check nightcoder’s answer if it is the case

  • (ASP.NET) Check this answer (by matrixugly) if it is the case

  • (ASP.NET) Ensure you have Edit and Continue enabled on the Web tab (vs2010)

  • (ASP.NET) Go to Properties > Web > Servers, and make sure that Enable and continue is checked under Use Visual Studio Development Server.

  • (ASP.NET WebAPI) Make sure you’ve stopped in the Controller’s method using a breakpoint, before trying to edit it.

  • (ASP.NET MVC) Conditionally compile app.UseResponseCompression() to exclude from Development environment from here.

  • (ASP.NET Core 6) If used with RuntimeCompilation make sure the nuget packages is updated past 6.0.9 Reference, be aware that Hot Reload without RuntimeCompilation is new recommended approach, but a workaround if affects performance.

  • (vs2017) Go to Tools > Options > Debugging and uncheck (deselect) ‘Edit and Continue’. This is actually the opposite of the ‘conventional’ advice (see some other points in this post). It does not allow you to actually make changes in your running program (i.e. it does not hot-swap the code changes that you make) – it simply allows you to edit your code (i.e. it prevents that annoying message and “locking” your editor).

  • Go to Tools > Options > Debugging > General and make sure Require source files to exactly match the original version is unchecked.

  • Check Enable Windows debug heap allocator (Native only) [VS Community 2017]

  • Are you using Microsoft Fakes? It inhibits Edit & Continue.

  • Kill all the *.vshost.exe instances by selecting End Process Tree in the Task Manager. VS will regenerate a correct instance.

  • Remove all the breakpoints with Debug->Delete All Breakpoints

  • Enable and Continue exists in both the Tools > Options > Debugging menu and also in the Project Settings. Be sure to check both places. edit & Continue is not supported with the extended Intellitrace setting.

  • Be sure Debug Info in Project Properties > Build > Advanced > Output > Debug Info is set to Full

  • Some plugin may be interfering. Check by disabling/uninstalling and then trying again the other solutions.

  • If you’re not paying enough attention, the error you get while trying to fix this may change to something else that is easier to diagnose. E.g. A method containing a lambda expression cannot support edit and continue.

  • Make sure the System variable COR_ENABLE_PROFILING and/or CORECLR_ENABLE_PROFILING is not set to 1. Some profilers set this when installing and leave it like that after uninstalling. Open a command prompt and type set to quickly check it your system is affected, if so remove the variable or set it to 0:

    • In Windows 8 and above, search for System (Control Panel).
    • Click the Advanced system settings link.
    • Click Environment Variables.
    • Remove COR_ENABLE_PROFILING and/or CORECLR_ENABLE_PROFILING
  • Be aware of unsupported scenarios (as reported in the question) and that unsupported edits.


* by ‘you’, I mean the visitor of the page who is hammering his head on a keyboard to find The solution.


Feel free to edit this answer to add your workaround if not listed here!

Leave a Comment