The Visual Studio Edit and Continue feature stopped on Visual Studio 2010, and I don't know what has caused the problem.
I am working on a Windows application program using C#. This application was initially developed in Visual Studio 2008, and later upgraded to Visual Studio 2010.
Everything was working fine, including Edit and Continue, until I upgraded the .NET Framework from 3.5 to 4.0.
Now when I use debug mode, changing any line of the code in the IDE results in the following message:
Edits were made which cannot compiled. Execution cannot continue until the compile errors are fixed.
Actually, there are no compilation errors, and I must restart the Visual studio to get the updates to run.
How can I get Edit and Continue to work again?
For me this was caused by Nuget failing to download a package (built for Net Framework) to a Net Standard project that was being referenced. Nuget entered an infinite loop (look in the output window).
The solution was to turn off the 'automatic package restore' setting see: https://developercommunity.visualstudio.com/content/problem/26638/nuget-infinite-loop.html
to access this setting Tools > Options > NuGet Package Manager > General
I had some Excel file
"embed interop types" == true
. When I changed it to false, edit and continue started working.In Visual Studio 2015, I've deleted the .vs folder (where the new style .suo file is), deleted all bin and obj, and also uninstalled Resharper 2015. Edit and Continue is back.
(side note: intellisense is now showing autocomplete almost instantly, whereas it was taking 2 to 5 seconds before, maybe resharper's fault, and maybe unrelated...)
In the Solution Explorer view, right-click on each reference of References, choose Properties. In the Properties view, sign False to the field of Embed Interop Types. This works for me.
In my case, what worked was unchecking "Require source files to exactly match the original version" in Debugging options. VS Community 2017 here.
I had used Microsoft's profiler yesterday and afterwards my "Edit and continue" feature got away. I finally realized after hours of frustration that I needed to execute VsPerfCLREnv /globaloff command from command prompt and restart my computer. Now I have my Edit and continue future back. It has nothing to do with target platform by the way. It works with target platform set to Any CPU without any hassle.