How do I enable file editing in Visual Studio'

2019-01-21 10:17发布

Is there a way to enable file editing while debugging in Visual Studio? I have unchecked the "Require the source file to exactly match the original version" checkbox. It makes no difference. I have to stop debugging to edit files. Very annoying. I enabled Edit and Continue. Same result. I disabled Edit and Continue - Same result.

9条回答
Viruses.
2楼-- · 2019-01-21 10:22

As far as I know you can uncheck the "Edit and Continue" checkbox.

Tools -> Options -> Debugging -> Edit and Continue > Enable Edit and Continue (uncheck)

查看更多
Juvenile、少年°
3楼-- · 2019-01-21 10:25

From MSDN

To enable/disable Edit and Continue

  • Open debugging options page (Tools / Options / Debugging). Scroll

  • down to Edit and Continue category. To enable, select the Enable Edit

  • and Continue check box. To disable, clear the check box. Note. ...

  • Click OK.

查看更多
趁早两清
4楼-- · 2019-01-21 10:36

Expanding on Reed's correct answer.

When in debug mode editing a file is using a feature known as Edit and Continue (commonly abbreviated ENC). This allows users to change their program as it is running in the debugger.

When ENC is enabled, users are allowed to perform a limited set of edits on their file. The next action which continues execution of the program (F10, F5, etc ...) will cause the edits to be applied to the running program. If this succeeds the execution of the program will continue with the new code applied.

The debugger does not allow edits to the file if ENC is not enabled.

There are a few reasons ENC may be disabled on your computer

  • Certain profiles do not enable ENC by default and it must be explicitly enabled
  • You may be running on a 64 bit OS and have your .Net app set to "Any CPU". ENC is not available on 64 bit (CLR limitation). You'll have to set the app back to x86 for ENC to work
查看更多
Melony?
5楼-- · 2019-01-21 10:40

For me this link Diabling IntelliTrace worked.
Go to

Tools > Options > IntelliTrace > (uncheck) Enable IntelliTrace

Or Debug > Options > IntelliTrace > (uncheck) Enable IntelliTrace

enter image description here

查看更多
何必那么认真
6楼-- · 2019-01-21 10:43

You need to enable Edit and Continue.

查看更多
Deceive 欺骗
7楼-- · 2019-01-21 10:44

If you have Edit and Continue turned on and you are using C# you can only edit a file if the debugger has stopped either via a break point or you manually breaking into the App via "Break All". You still won't be able to edit some files, Ex. xaml files in a WPF app, but it should solve most problems.

查看更多
登录 后发表回答