c# - 无法更改 Visual Studio 中的事件目标框架

标签 c# visual-studio visual-studio-2022

我的 C# 类库面向多个版本的 .NET。

<TargetFrameworks>net7.0;net6.0;net5.0;netstandard2.0</TargetFrameworks>

但是当我编辑代码时,它似乎通过将非 .NET Standard 目标的行灰显来将 .NET Standard 显示为事件目标。

enter image description here

我的问题是:这个套装在哪里?它如何确定哪个目标是事件目标。我到处都看过,但不知道如何改变这一点。

最佳答案

使用文档顶部的下拉菜单更改您的目标框架。

enter image description here

关于c# - 无法更改 Visual Studio 中的事件目标框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75808191/

相关文章:

c# - 南希模型绑定(bind)

来自 toolStrip 的 C# DragDrop

c++ - VS 编译警告 : result of 32-bit shift implicitly converted to 64 bits

c# - 防止控制台应用程序(.NET Core)在 VS2019 和 VS2022 中打印 "exited with code 0."

c# - Linq to SQL ForeignKeyReferenceAlreadyHasValueException

c# - 在 ASP.NET Core 中访问 _Layout.cshtml 中的 cookie

c# - 目标 BeforeBuild 在 csproj 中不起作用

visual-studio - AnkhSvn 撤销/恢复提交

azure - 无法使用 Visual Studio 发布 Azure Function : Create button disabled

.net - 如何在 Visual Studio 2022 中创建物理文件夹