0

We updating to Autofac 2.4.4 after moving up to MVC3 and are receiving an exception when we include EnableInterfaceInterceptors on our registration. The exception does not appear until DependencyResolver.Current.GetService<ISite>() is called.

Exception:

Could not load type 'System.Func`2' from assembly 'App.AutofacContrib.DynamicProxy2, Version=2.4.4.705, Culture=neutral, PublicKeyToken=null'.

Registration:

builder.RegisterType<SendEmailTask>().As<ITask>().InstancePerDependency().EnableInterfaceInterceptors();

Note: In order to deal with conflicts in the different versions of Castle we performed an ILMerge on AutofacContrib.DynamicProxy2.dll and Castle.Core.dll.

Thad
  • 1,518
  • 2
  • 21
  • 37

1 Answers1

0

Looks like a problem with the IL merge - rather than merging, have you tried assembly binding redirects?

Nicholas Blumhardt
  • 30,271
  • 4
  • 90
  • 101
  • I was not able to get it to compile. SlimReaderWriterLock is not in latest version of Castle.Core so bindingRedirect failed. – Thad Mar 10 '11 at 14:28
  • I ended up having to upgrade some other components in order to get it working. – Thad Mar 10 '11 at 19:09