程序集A引用log4net 1.2.10.0,而程序集B引用log4net 2.0.8.0
由于程序集A找不到程序集,我在运行时遇到了异常。
System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821'
我尝试了以下选项,但没有运气。
使用的参考文献:
how-to-resolve-net-reference-and-nuget-package-version-conflicts
how-exactly-does-the-specific-version-property-of-an-assembly-reference-work-i
how-do-i-redirect-assembly-binding-to-the-current-version-or-higher