“Edits were made which cannot be compiled” . zero errors and Enable and edit and continue is checked in vs2010

前端 未结 7 1363
青春惊慌失措
青春惊慌失措 2020-12-29 04:21

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

相关标签:
7条回答
  • 2020-12-29 04:41

    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.

    0 讨论(0)
  • 2020-12-29 04:42

    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.

    0 讨论(0)
  • 2020-12-29 04:47

    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.

    0 讨论(0)
  • 2020-12-29 04:51

    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
    
    0 讨论(0)
  • 2020-12-29 04:57

    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.

    0 讨论(0)
  • 2020-12-29 04:59

    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, FileSource controlAdvancedWorkspaceRemove.

    0 讨论(0)
提交回复
热议问题