将 .NET 从 6 更新到 8 - 检测到包降级:直接从项目引用包以选择不同版本

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

将目标框架从 .NET 6 更改为 8 后,我尝试升级项目中的多个包,但我不知道如何解决此错误。当我尝试将包 System.Configuration.ConfigurationManager 从 6.0 更新到 8.0 时,出现此错误:

Warning As Error: Detected package downgrade: YamlDotNet from 15.1.2 to 11.2.1. Reference the package directly from the project to select a different version.

但是当我尝试将 YamlDotNet 从 11.2.1 更新到 15.1.2 时,出现此错误:

Warning As Error: Detected package downgrade: System.Configuration.ConfigurationManager from 8.0.0 to 6.0.0. Reference the package directly from the project to select a different version.

我也从其他包中得到了类似的行为。那么每个包都会阻止另一个包升级吗?我该如何解决这个问题?

.net .net-6.0 .net-8.0
1个回答
0
投票

这些消息通常表明您错过了某些依赖项目的升级。

为了安全起见,您应该将解决方案中的所有项目升级到 .Net 8.0,并将所有项目中的所有库更新到最新版本(仅在所有更新后构建)。

如果这也没有帮助,请删除所有项目中的

bin
obj
文件夹并从头开始重建解决方案。

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