visual-studio - 禁止在调试时编辑代码

标签 visual-studio debugging asp.net-core visual-studio-2019

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

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

作为引用,这是我想要的弹出窗口:

enter image description here

这些是我的设置:

enter image description here

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

enter image description here

最佳答案

根据 VS 团队的说法,这是按设计工作的:

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

关于visual-studio - 禁止在调试时编辑代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58299640/

相关文章:

visual-studio - Visual Studio 2008 - 小 map

c# - 在图片上添加点击事件

Docker:处理用户上传和保存文件

c# - 使用 TestServer 在 AspNetCore 中的集成测试中模拟和解决 Autofac 依赖性

c# - Web 应用程序项目和 App_GlobalResources

c# - Crystal Reports 中的组过滤

perl - 如何在调试器下运行perl代码块?

sql - 我可以查看通过 ODBC 连接发送的所有 SQL 语句吗?

python - 在 Python 中调试 : Show last N executed lines

c# - 为什么 Entity Framework (Core) 在 Add() 操作中删除旧记录?