gpt4 book ai didi

.net - "Detected package downgrade"警告是什么意思?

转载 作者:行者123 更新时间:2023-12-04 13:57:11 26 4
gpt4 key购买 nike

当我跑 dotnet restore (或在 Visual Studio 中运行包还原),我看到如下警告:

  • /usr/local/share/dotnet/sdk/1.0.4/NuGet.targets(97,5): warning : Detected package downgrade: Microsoft.EntityFrameworkCore.Design from 1.1.1 to 1.0.3 [/Users/markamery/somesolution/SomeSolution.sln]
  • /usr/local/share/dotnet/sdk/1.0.4/NuGet.targets(97,5): warning : SomeProject (>= 1.0.0) -> Microsoft.EntityFrameworkCore.Tools (>= 1.1.0) -> Microsoft.EntityFrameworkCore.Design (>= 1.1.1) [/Users/markamery/somesolution/SomeSolution.sln]
  • /usr/local/share/dotnet/sdk/1.0.4/NuGet.targets(97,5): warning : SomeProject (>= 1.0.0) -> Microsoft.EntityFrameworkCore.Design (>= 1.0.3) [/Users/markamery/somesolution/SomeSolution.sln]


我正在努力解析上面警告的含义。各种事情我不清楚:
  • 在这种情况下,什么是“软件包降级”?
  • 是什么导致“软件包降级”发生?
  • “检测到的包裹降级”下面的行是什么意思?特别是,包裹之间的箭头 ( -> ) 传达了什么?
  • 最佳答案

    在这种情况下,您的依赖关系图引用了 Microsoft.EntityFrameworkCore.Design 的两个版本.这由包含 -> 的行表示:

    在第一行之后,它显示您的项目引用了 Microsoft.EntityFrameworkCore.Tools版本1.1.0 ,它被解析为一个包,该包又引用了 Microsoft.EntityFrameworkCore.Design在版本 1.1.1 .

    然后显示你的包直接引用了Microsoft.EntityFrameworkCore.Design1.0.3 .

    NuGet documentation for dependency resolution规定了适用于这种情况的规则:

    Nearest wins

    When the package graph for an application contains different versions of the same package, the package that's closest to the application in the graph is used and others are ignored. This allows an application to override any particular package version in the dependency graph.



    此规则适用于此处,因为您的应用程序直接引用与另一个依赖项不同的包版本。由于此版本较低,NuGet 会发出警告来提醒您,因为其他依赖项可能需要较低版本中不存在的某些功能。该文档还包含有关此的警告:

    The Nearest Wins rule can result in a downgrade of the package version, thus potentially breaking other dependencies in the graph. Hence this rule is applied with a warning to alert the user.

    关于.net - "Detected package downgrade"警告是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44307993/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com