(除非抛出:)重新启动 Visual Studio 2022 时复选框将被取消选中

问题描述 投票:0回答:1

使用 for 循环在视图中填充 HTML 表单属性时,我遇到了意外的

System.NullReferenceException

发生错误时,程序中断并显示此提示:

Error image prompt

当我检查从

Microsoft.AspNetCore.Mvc.ViewFeatures.dll
复选框抛出的异常时,程序停止抛出此错误。但是,当我重新启动 Visual Studio 2022 时,该框未被选中,我必须再次手动检查它。

我怎样才能让它保持选中状态?

我正在使用 ASP.NET Core 7 MVC。

exception asp.net-core-mvc visual-studio-2022 .net-7.0
1个回答
0
投票

根据本文件 https://learn.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger?view=vs-2022#add-and-delete-exceptions

异常设置保留在解决方案的 .suo 文件中,因此它们适用于特定的解决方案。

因此请确保

.suo
文件未被删除或重置。 (“.vs”是隐藏文件夹)

© www.soinside.com 2019 - 2024. All rights reserved.