NuGet Package is Looking for Exact Version

寵の児 提交于 2020-04-11 18:32:06

问题


I have a NuGet Package called ConfigurationManagement. It has a dependency on the Nuget Package called Jil (json parser). The version listed is 2.15.4.

I have another package called Logging.Client that needs Jil 2.17.0.

When I look at them, the ConfigurationManagement package says it needs >= 2.15.4. Which leads me to think that I should just be able to use 2.17.0.

But when I try to do that, I get the following runtime error:

System.IO.FileNotFoundException: 'Could not load file or assembly 'Jil.Core, Version=2.15.4.0'

I tried adding a reference directly to Jil 2.17.0 in the project referencing ConfigurationManagement and the Packages tree in Solution Explorer shows that it will use Jil 2.17.0 for ConfigurationManagement, but I still get the runtime exception.

How can I get my ConfigurationManagement package to use the 2.17.0 version of Jil? (Preferably without having to update the ConfigurationManagement package as another group owns that.)


ConfigManagement.csproj that references ConfigurationManagement :

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ConfigurationManagement" Version="4.2.1.5" />
    <PackageReference Include="Sigil" Version="5.0.0" />
    <PackageReference Include="Jil" Version="2.17.0" />
  </ItemGroup>

</Project>

Project File that references Logging.Client and the Project above:

<Project Sdk="Microsoft.NET.Sdk">

 <PropertyGroup>
   <TargetFramework>netcoreapp3.1</TargetFramework>
 </PropertyGroup>

 <ItemGroup>
   <PackageReference Include="ARUPConfiguration" Version="4.2.1.5" />
   <PackageReference Include="Logging.Client" Version="6.1.0.14" />
   <PackageReference Include="Sigil" Version="5.0.0" />
   <PackageReference Include="System.Runtime.Caching" Version="4.7.0" />
 </ItemGroup>

 <ItemGroup>
   <ProjectReference Include="..\Config\ConfigManagement.csproj"/>
   <ProjectReference Include="..\DataCacheInterfaces\DataCacheInterfaces.csproj" />
   <ProjectReference 
 </ItemGroup>

</Project>

来源:https://stackoverflow.com/questions/60609571/nuget-package-is-looking-for-exact-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!