简体   繁体   English

Visual Studio 2022 调试器认为我更改了代码并想要热重载

[英]Visual Studio 2022 Debugger thinks I changed code and wants to hot reload

EDIT: Good information provided below to diagnose, but the issue was I was running Visual Studio 2022 17.3.编辑:下面提供了很好的诊断信息,但问题是我运行的是 Visual Studio 2022 17.3。 Version 17.4 is required for .NET 7, and I had just installed that. .NET 7 需要版本 17.4,我刚刚安装了它。 Once I installed the latest version of VS, all my problems went away.一旦我安装了最新版本的 VS,我所有的问题都消失了。 Install with Visual Studio 使用 Visual Studio 安装

Suddenly today, debugging my ASP.NET Core 6 and 7 apps suddenly has stopped working.今天突然调试我的 ASP.NET Core 6 和 7 应用程序突然停止工作。 I hit F5 to debug, it stops on my breakpoint, but as soon as I continue or step into, I'm shown this dialog:我按 F5 进行调试,它在我的断点处停止,但只要我继续或进入,我就会看到这个对话框: 在此处输入图像描述

I haven't made any changes to code, I'm simply trying to continue after I've stopped at a breakpoint.我没有对代码进行任何更改,我只是在断点处停止后尝试继续。 This just started happening today and I can't figure out what I did.这只是今天才开始发生,我无法弄清楚我做了什么。

I haven't made any changes to code, I'm simply trying to continue after I've stopped at a breakpoint.我没有对代码进行任何更改,我只是在断点处停止后尝试继续。 This just started happening today and I can't figure out what I did.这只是今天才开始发生,我无法弄清楚我做了什么。

Well, if your visual studio stop working for debugging all type of application, please check following configuration:那么,如果您的 visual studio 停止调试所有类型的应用程序,请检查以下配置:

1. Tools > Options > Debugging > .NET/C++ Hot Reload 1. 工具 > 选项 > 调试 > .NET/C++ 热重载

在此处输入图像描述

2. Tools > Options > Projects and Solutions > ASP.NET Core > 2. 工具 > 选项 > 项目和解决方案 > ASP.NET Core >

在此处输入图像描述

Furthermore, If you select the Always rebuild option in the dialog box, you won't see the dialog box again in the current Visual Studio session, and Visual Studio will automatically rebuild and reload instead of showing the dialog box.此外,如果您 select 对话框中的 Always rebuild 选项,您将不会在当前的 Visual Studio session 中再次看到该对话框,并且 Visual Studio 将自动重建并重新加载,而不是显示该对话框。

Note:笔记:

在此处输入图像描述

In addition, as you can see above in the first release of Visual Studio (version 17.0) the standard Edit and Continue dialog is still shown when using Hot Reload with the debugger.此外,正如您在 Visual Studio 的第一个版本(17.0 版)中看到的那样,在调试器中使用热重载时,标准的“编辑并继续”对话框仍会显示。 This was a bug and has been resolved starting with 17.1 Preview 2 release.这是一个错误,从 17.1 预览版 2 版本开始已得到解决。

If you still need more details about the issue you are having with, I would higly recommend you to check our official document here.如果您仍然需要有关所遇到问题的更多详细信息,我强烈建议您在此处查看我们的官方文档。

If issue still perist:如果问题仍然存在:

After checking above configuration, if your issue still persists and if you are not using Visual Studio (version 17.0) then you still reset your unknown setting in visual studio as following:检查以上配置后,如果您的问题仍然存在并且您没有使用Visual Studio (version 17.0) ,那么您仍然在 Visual Studio 中重置您的未知设置,如下所示:

Go to Tools > Import and Export Settings. Go 到工具 > 导入和导出设置。

在此处输入图像描述

Then No, just reset settings然后不,只是重置设置

Finally, restart Visual studio.最后,重新启动 Visual Studio。

You can get more details here. 您可以在此处获取更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM