I am able to edit my code in debug mode but then pop up shows the error that \"Edits were made which cannot be compiled. Execution cannot continue until the compile errors a
Potentially this is caused by Visual Studio's Edit & Continue
feature.
A workaround is to disable this feature:
Debug --> Options --> Debugging --> General --> uncheck Enable Edit and Continue
Solution taken from here.
Also answered here.
This problem can occur when your workspace broke. Just close Visual Studio, delete (or better first just rename) the .vs
folder and start Visual Studio again.
It can even happen with VS2017.
I had the same problem (VS2017), for me it was enough to menu item Build and click Clean Solution Then Rebuild Solution and everything worked fine again.
I've had this problem with Visual Studio 2008, 2010, and 2013. I wrote a batch file I keep in the solution folder for each of my projects when this problem crops up. Expanding on what Vijay said, this cleans out the bin and obj folders. Sometimes Visual Studio will have the folders locked and I have to close it, but after I clear these out the problem goes away... for a while. I'm not sure of the underlying cause, I believe the binaries and the code in memory is somehow getting out of sync. But this allows a quick close, clean, open solution.
@echo off
cls
dir bin /s /AD /b > clean.tmp
dir obj /s /AD /b >> clean.tmp
for /F "tokens=*" %%A in (clean.tmp) do echo rmdir /S /Q "%%A"
echo This command will remove ALL BIN and OBJ folders in this tree.
echo To run the commands as listed ...
pause
for /F "tokens=*" %%A in (clean.tmp) do rmdir /S /Q "%%A"
del clean.tmp
pause
I had this problem as well in a c# project. It turns out it was because I had recently enabled the "Enable native code debugging" option.
Turning it off restored the functionality.
I am using Visual Studio 2017 Community updated as to date.
After hours spent trying all the solutions posted in this thread highlighted by Hao Nguyen in the comments above, the only solution that worked was to remove the Workspace and Map&Get
again.
To remove the Workspace, File
→ Source control
→ Advanced
→ Workspace
→ Remove
.