Assembly binding redirect and it's relation with specific version property in assembly references

0
  1. Why binding redirect not working in below scenraio? Am I doing anything wrong here? How to fix? I don't want to refer log4net from GAC as I want to refer assemblies from local folder.
  2. Is there any relation with specific version property in assembly references and assembly binding redirection? I'm not sure if Assembly A here is compiled using specifc version set to true for log4net refernces as it is from third party and legacy code and this is the cause for assembly binding redirection not to work.

Assembly A references log4net 1.2.10.0 while Assembly B references log4net 2.0.8.0

The manifest of assembly A is as below: enter image description here

I'm getting below exception at run-time as Assembly A can't find the assembly.

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'

I've tried below options and no luck.

  • Added binding redirection in app.config as below. [solution 1 in first link below]

    enter image description here

  • Copied assemblies to different folders and used to load them side-by-side. [solution 3 in first link below]

    enter image description here

References used:

how-to-resolve-net-reference-and-nuget-package-version-conflicts

redirect-assembly-versions

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

net-reference-specificversion-true-or-false

c#
.net
visual-studio

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0