禁止在调试时编辑代码 [英] Disable being able to edit code while debugging

查看:64
本文介绍了禁止在调试时编辑代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近在调试应用程序时,当应用程序未处于损坏状态时,我已经能够将代码写入C#文件中.我尝试完全禁用Visual Studio选项中的编辑并继续"设置,但这似乎不起作用.

Recently when I've been debugging my application, I've been able to write code into C# files when the application isn't in the broken state. I've tried totally disabling the "Edit and Continue" setting in the visual studio options but that doesn't seem to be working.

我期望发生的是在调试时,当我键入C#文件时,我希望弹出窗口显示应用程序运行时不允许更改",提示我在代码中放置一个断点在应用程序处于暂停状态时在运行时应用更改.我不确定这是否是2019年最新版本中引入的更改,或者我的选择是否有问题.关于这个的任何想法都很棒.

What I'm expecting to happen is when I'm debugging and I type into a C# file, I want that popup that says "Changes are not allowed while the application is running" prompting me to put a breakpoint in my code to apply changes during runtime while the application is in the paused state. I'm not sure if this was a change that was introduced into the latest 2019 build or if there's something wrong with my options. Any ideas on this one would be great.

作为参考,这是我想要的弹出窗口:

For reference, this is the popup that I want:

这些是我的设置:

以及我不想要的功能的证明

and proof of the functionality that I don't want

推荐答案

根据VS团队的说法,此方法可以按设计工作:

According to the VS Team this works as designed:

您描述的此行为对于Visual Studio 16.3是预期的.我们在编辑并继续"上进行了几处更改,现在允许在应用程序运行时编辑代码.任何错误或有关更改的警告将显示在错误列表"窗口中.为了应用这些更改,您只需休息一下状态(例如全部中断或在断点处停止)并从在那里.

This behavior you described is expected for Visual Studio 16.3. We went through several changes on Edit and Continue and now allow editing the code while the application is running. Any errors or warnings regarding your changes will show up at the Error List Window. In order to apply these changes, you simply have to be on a break state (e.g. break all or stop on a breakpoint) and continue from there.

来源: https://developercommunity.visualstudio.com/content/problem/768979/able-to-type-while-debugging.html

这篇关于禁止在调试时编辑代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆