问题
I've started getting weird errors whenever I hit a breakpoint and either try to step over it or into it.
I get the message:
Edits were made which cannot be compiled. Execution cannot continue until the compile errors are fixed.
The projects are compiling just fine and this does not happen when I don't hit any breakpoints. I'm using Visual Studio 2019, 16.3.1 and this happens in all of my solutions, not just one. I've tried the following but nothing has worked:
- Clearing my .vs-folder
- Restarting Visual Studio
- Restarting the computer
- Clean and Rebuild
- Removing all breakpoints and adding them again
- All suggested answers here but none worked.
- Upgrading to 16.3.2
- Repairing Visual Studio
What more can I try?
Update: I followed the advice from @HansPassant and disabled Edit and Continue and that solved the most urgent problem but it seems like a hacky workaround.
回答1:
Seems to be related to this issue that they have a preview fix for in 16.4 https://developercommunity.visualstudio.com/content/problem/705494/without-any-changes-to-source-files-edits-were-mad.html?childToView=767405#comment-767405
Hi everyone, we are sorry about your experience with Edit and Continue. Yes, we were aware of the issue. Unfortunately, there are different issues that share the same symptom. We are working towards fixing all of them, it might just take some time until we are able to actually track all of them down.
The fix for this particular issue will only be available at 16.4 Preview 3+; - If you want more details on the fix, you can check it out on Roslyn: https://github.com/dotnet/roslyn/pull/38905
We suspect this will address the most common issues found in Edit and Continue, e.g. the one reported in this ticket. We will let you know when it's available for download by updating this same ticket.
来源:https://stackoverflow.com/questions/58219423/compilation-errors-when-stepping-over-breakpoints