Compilation errors when stepping over breakpoints

浪子不回头ぞ 提交于 2021-02-07 18:38:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!