[英]Cannot write code in visual studio while debugging
在visual studio中,转到Tools-> Options-> expand debugging - >选择Edit并继续,然后选中Enable edit并继续。 这是图像: 见截图
如果您附加到已经运行的进程,通常无法编辑和继续,如果您附加到正在运行的MVC Web项目,则可能是您的情况。 如果使用Reflection加载某些内容,您也无法对其进行编辑。
我还看到有时在调试期间出现类似的消息。 我在MSDN中找到了以下有关调试期间代码更改的内容:
The following changes cannot be applied to C# code during a debugging session:
- Changes to the current statement or any other active statement.
- Active statements include any statements, in functions on the call stack, that were called to get to the current statement.
- The current statement is marked by a yellow background in the source window. Other active statements are marked by a shaded background and are read-only. These default colors can be changed in the Options dialog box.
- Changing the signature of a type.
- Adding an anonymous method that captures a variable that hasn’t been captured before.
- Adding, removing, or changing attributes.
- Adding, removing, or changing using directives.
- Adding a foreach, using, or lock around the active statement.
更多信息: https : //msdn.microsoft.com/en-us/library/ms164927.aspx
所以,经过大量的研发后我才知道编辑和继续不适用于Asp.net 。 它将在Visual Studio 15的最终版本中发布。
来源: https : //blogs.msdn.microsoft.com/visualstudioalm/2015/04/29/net-enc-support-for-lambdas-and-other-improvements-in-visual-studio-2015/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.