0

I have 2 projects in my solution.

One uses Autofac 3.5.2 and the other is used Autofac.Extras.DynamicProxy2 for interception (Autofac 3.3.1). The one with Autofac 3.3.1 has project reference to the one with Autofac 3.5.2. Trying to run different dll versions in my solution fails, while upgrading 3.3.1 to 3.5.2 skips interceptor logic.

I would like to run interception on Autofac 3.5.2 since I use 3.5.2 on many other project I develop.

Did someone faced this issue with success?

Thank you

The error I get is: Error 5 Assembly ' , Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' which has a higher version than referenced assembly 'Autofac, Version=3.3.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da'

Roi Shabtai
  • 2,981
  • 2
  • 31
  • 47

1 Answers1

0

You have to use assemblyBinding:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" 
                          culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
Cyril Durand
  • 15,834
  • 5
  • 54
  • 62