【发布时间】:2018-01-13 15:32:24
【问题描述】:
假设我在我的项目中使用 NuGet 包,它依赖于 x.y.z 的 1.2.3 版。但是,我想测试一下 NuGet 包是否适用于 x.y.z 的 1.1.1 版。
我曾尝试以这种方式在我的项目的 App.config 中进行程序集绑定,将 1.1.1 版本放置在 1.2.3 所在的同一目录中。
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="x.y.z" publicKeyToken="xxxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.3 newVersion="1.1.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
但是,我仍然收到此错误:
Could not load file or assembly 'x.y.z, Version=1.2.3, Culture=neutral,
PublicKeyToken=xxxx' or one of its dependencies.
The system cannot find the file specified.
有什么想法可以测试 NuGet 包是否适用于较低版本的 dll 吗?
谢谢
【问题讨论】:
标签: c# .net dependencies nuget assembly-binding-redirect