提问人:rory 提问时间:9/27/2023 更新时间:9/28/2023 访问量:24
.Net Core 查找引用程序集的较低版本
.Net Core looking for a lower version of referenced assembly
问:
嗨,我的 .net 核心项目中有一个引用 System.IO.Abstractions 17.2.3 的外部 dll
但是,当我的项目尝试加载此dll时,它会抛出以下错误:
Could not load file or assembly 'System.IO.Abstractions, Version=17.0.0.0, Culture=neutral, PublicKeyToken=96bf224d23c43e59'. The system cannot find the file specified.
我的项目project.assets.json没有引用它,我引用的 dll project.assets.json也没有引用(它是我们自己的 dll 之一)。
我尝试将其添加到我的 Web 应用程序的 csproj 中,但没有喜悦
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
是什么原因导致它寻找 17.0.0.0 而不是 17.2.3?
答:
0赞
ΩmegaMan
9/28/2023
#1
在 Nuget 中,请确保将每个包设置为 而不是 .其他一些包可能正在获取导致主代码出现此错误的版本。[get] the latest
least version
评论
<PackageReference Include="System.IO.Abstractions" Version="17.2.3" />