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条回答
Luminary・发光体
2楼-- · 2019-01-21 10:45

usually editing a file during debugging is possible when you have hit a breakpoint (and only then).

There are some restrictions though: -your new code must compile -you cant change code in a function that contains lambda expressions

查看更多
够拽才男人
3楼-- · 2019-01-21 10:45

If your source origins from a decompiled dll, note that decompilers may add an IgnoreSymbolStoreSequencePoints instruction to assemblyinfo.cs:

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]

This line must be removed in order to load the pdb-file, making edit & continue work.

查看更多
姐就是有狂的资本
4楼-- · 2019-01-21 10:47
  • UNcheck "Enable Edit and Continue" (Tools -> Options -> Debugging -> Edit and Continue > Enable Edit and Continue)
  • Build your app.
  • Run it.
  • Stop it.
  • REcheck "Enable Edit and Continue".
  • Build your app.
  • Run it.
  • Try editing the files while debugging now.

This worked for me. I believe it might be some bug or syncing issue with Visual Studio 2015.

查看更多
登录 后发表回答