a library project which is using .NET framework 4.7 , the project file looks like
<ItemGroup>
<PackageReference Include="A" Version="1.0.0"/>
<PackageReference Include="B" Version="4.0.0"/>
<PackageReference Include="C" Version="2.0.0"/>
</ItemGroup>
Here package A references 2.0.0 version of package B . Package C references 2.0.0 version of package B. After building the solution , the assembly information tool does not show 4.0.0 version of package B. The project still uses 2.0.0 version of package B.
In both Packages A and C, Package B is referenced like this .
<Reference Include="B, Version=2.0.0.0, Culture=neutral, PublicKeyToken=852c01e1b0b6deeb, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>packages\B.2.0.0\lib\net20\B.dll</HintPath>
</Reference>
We can't update Package A and Package C.
We tried using bindingRedirect but that did not work .
What changes can be done in this project file so that the dll only references 4.0.0 version of package B?