【发布时间】:2021-06-07 08:37:18
【问题描述】:
网络核心应用程序。我创建了一些名为 Authorization 的类库项目,它引用了
<PackageReference Include="Microsoft.Identity.Web" Version="1.10.0" />
然后我有另一个类库项目,我有参考
<PackageReference Include="Azure.Identity" Version="1.2.3" />
我已将这两个类库应用程序推送到 azure artifact 并在当前应用程序中使用它。当我尝试构建解决方案时,它给了我以下错误
RepositoryLayer.csproj :
error NU1605: Detected package downgrade: Azure.Identity from 1.3.0 to 1.2.3. Reference the package directly from the project to select a different version.
RepositoryLayer.csproj :
error NU1605: RepositoryLayer -> Consume 1.1.46955 -> HttpClients 1.1.46955 ->
Authorisation 1.1.46955 -> Microsoft.Identity.Web 1.10.0 -> Azure.Identity (>= 1.3.0)
RepositoryLayer.csproj :
error NU1605: RepositoryLayer -> Azure.Identity (>= 1.2.3)
已经花费了数小时来确定这一点,但无法理解根本原因。有人可以帮我确定这个问题。任何帮助,将不胜感激。谢谢
【问题讨论】:
-
尝试删除对
Microsoft.Identity.Web的引用 -
您好 Hirasawa,我需要在我的应用程序中引用它。我可以知道可能是什么问题吗?
-
Microsoft.Identity.Web 已经包含对 Azure.Identity 的引用作为其依赖项之一。所以,不要同时使用这两个包。或者安装相同的版本。
-
Microsoft.Identity.Web 在一个类库应用程序中(作为 nuget 推送),Azure.Identity 在一个类库中(作为 nuget 推送)。现在我在我当前的 api 应用程序中使用这两个应用程序并导致问题。有没有办法解决这个问题?
-
是的,安装 Azure.Identity 版本 1.3.0
标签: c# asp.net-core nuget nuget-package-restore