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?
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 worked for me.
For who still gets this error even with Visual Studio 2017
No dynamic/Portable Class Libraries/Nuget packages or dependancy problems. No errors or warning highlighted by Visual Studio.
After hours spent trying all the solutions posted in this and other threads and webpages, the only solution that worked for me was to check-in, remove the Workspace and
Map&Get
again.To remove the Workspace,
Source control
→Advanced
→Workspace
→Remove
.I'm using Visual Studio 2017 Community up to date and after a relatively fresh install on a new machine (one week and few work hours).
Methods I've tested with no success prior to the solution above
<_ResolveReferenceDependencies>
totrue
as explained hereAfter this, I made a check-in and downloaded the Solution on another machine running the same version of Visual Studio (2017 Community). As I didn't get the Edit&Continue issue there, I went for the Workspace removal.
In VS2013 I had to enable "Use Managed Compatibility Mode" in the debugging options. I think it is because I have a .Net 4 project referencing a .Net 2 assembly.
For another project in the same solution I had to uncheck "Define TRACE constant" in the project properties.
I tried all the above solutions none of them worked for me. However, when I deleted the bin and object folders in visual studio and run again, it start to work.
I had this problem in Visual Studio 2013, and :-
In my case, I didn't have any Interop types that were embedded, nor did any of my code have the
dynamic
keyword, and I had performed a full solution clean without success. I had been running, debugging and re-starting many times, however, so it may have had something to do with memory -- it took Visual Studio more than one minute to close, during which time the disk was thrashing (presumably memory paging at play).In my situation, someone added a Reference to the Project's output into the Reference list: in Solution Explorer look under [ProjectName]\References for [ProjectName*] and remove it.
If the project is relying on code from a copy of itself, you can't 'Edit and Continue'. In the warning list you may or may not (more likely to in a larger project) have 'conflicts with imported type' messages if this is the cause of the problem.