简体   繁体   中英

Different versions between a nuget package and its referenced nuget packages

I have an Azure Function (version 3, dotnet 3.1) referencing the following nuget package:

Microsoft.Extensions.Configuration

When I try to install this nuget, I get the version 5.x of the package, which causes the installation of

Microsoft.Extensions.Configuration.Abstractions

But I have conflicts when running my function. The solution found on several other topics, is to downgrade the nuget package, as the Azure Function doesn't support 5.0 dependency for the Microsoft.Extensions.Configuration.Abstractions package.

So I execute the following command line in the package manager console to install the initial nuget package:

Install-Package Microsoft.Extensions.Configuration -Version 3.1.14 -DependencyVersion Lowest

But it always install the version 5.x of the dependency "Microsoft.Extensions.Configuration.Abstractions"

Any advice to download the right version of the dependency?

I used the command you gave, everything seems to be no problem:

在此处输入图像描述

1. As Sara Liu-MSFT mentioned in the comments, you may need to check whether other assemblies reference Microsoft.Extensions.Configuration.Abstractions . If so, you may need to downgrade that assembly.

You can check here:

在此处输入图像描述

2. Or you can try to manually reference the Microsoft.Extensions.Configuration.Abstractions assembly:

<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.14" />

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM