[英]Do .NET Core SDK / Runtime and NuGet Package Versions have to match?
[英]Issue with Nuget package versions in .NET Core
網絡核心應用。 我創建了一些名為 Authorization 的 class 庫項目,它參考了
<PackageReference Include="Microsoft.Identity.Web" Version="1.10.0" />
然后我有另一個 class 庫項目,我有參考
<PackageReference Include="Azure.Identity" Version="1.2.3" />
這兩個 class 庫應用程序我已推送到 azure 工件,我在當前應用程序中使用它。 當我嘗試構建解決方案時,它給了我以下錯誤
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)
已經花了幾個小時來確定這一點,但無法理解根本原因。 有人可以幫我確定這個問題。 任何幫助,將不勝感激。 謝謝
3個步驟:
(1)使用最新版本
https://www.nuget.org/packages/Azure.Identity ( 1.4.0
)
https://www.nuget.org/packages/Microsoft.Identity.Web ( 1.12.0
)
(You should use .NET 5 SDK 5.0.6 with Azure.Identity
1.4.0
and Microsoft.Identity.Web
1.12.0
for ensuring compatibible)
(2)清理 Nuget 緩存,然后再次獲取 nuget package。
您可以/應該刪除文件packages
中的所有舊東西以清除所有舊東西。 我想確保不存在損壞的文件。
(3)刪除bin
, obj
, 重新構建項目。
讓我們分享你的結果。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.