BindingRedirect For custom Action - Advanced Installer Community
pimboden40
Posts: 22
Joined: Wed Jun 04, 2014 3:42 pm

BindingRedirect For custom Action

Hello.
My Installer Project Uses a Library written in C# for Custom Actions.
This Library uses another Library that uses log4Net ( a library for logging) version 1.2.15.0, at the same time it uses another library that in itself uses log4net version 1.2.13.0.
Normaly this is not a problem for c# . You can just add a Binding redirect in the config of the library that uses the higher version like

Code: Select all

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
        <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.2.15.0" newVersion="1.2.15.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
 
I Added this to my the library that uses log4net 1.2.15.0, and added the config then to the files of the Project.But as soon as my custom action wants to instantiate this library, it crashes, because it says it can't load log4net 1.2.13.0.
I tryed to add the config as a temporary file, but it didn't work either.
Can you tell me what do I have to do, so the BindingRedirect works?
Thank you
pimboden40
Posts: 22
Joined: Wed Jun 04, 2014 3:42 pm

Re: BindingRedirect For custom Action

Ohh man!
I hate it when this happens.
Just had to put my Binding redirects to the config file of my custom Action library, and not to the library that is actually using the log4net.
and now it works like a charm. :D
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: BindingRedirect For custom Action

Hello,

I'm glad you got this working by yourself.
Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”