VS 2022 17.9 习惯于自行向 WPF 应用程序添加导入。我会收到类似“.ToolTip is not a member of Button”的错误 - 当我返回页面时,我发现已添加了各种导入,如下所示:
Imports WinRT
Imports Microsoft.Graph.Models
Imports Xceed.Wpf.AvalonDock.Themes
Imports System.Windows.Forms
Imports DevComponents.WpfEditors
Imports Microsoft.Graph.Groups.Item.Planner.Plans.Item.Buckets.Item.Tasks.Item.Details
Imports Microsoft.Graph.Groups.Item.Planner.Plans.Item.Details
Imports Microsoft.Graph.Groups.Item.Planner.Plans.Item.Tasks.Item.Details
Imports Microsoft.Graph.Models
Imports Microsoft.Identity.Client.NativeInterop
Imports Windows.Security.Authentication.Web.Provider
有什么办法可以阻止这种行为吗?
您可以取消选中“在粘贴时添加缺少的导入”。
可在“选项”→“文本编辑器”→“Visual Basic”→“高级”→“导入指令”中使用。