I've got an existing, working web app written in MVC3, using Autofac and Autofac.Mvc3. I now need to use SignalR, so I've pulled in Autofac.SignalR via Nuget, which has upgraded Autofac.dll to 3.0.0.
What I'm noticing now, is that when I'm trying to register a type, I get a MissingMethodException when I call InstancePerHttpRequest
as the lifetime for a type.
As an exercise, I tried doing what my current application's autofac registration is doing in a brand new MVC4 application, with Autofac.Mvc4 and Autofac.SignalR, which seems to work just fine.
Any help would be appreciated
Example lines that trigger the error
builder.RegisterType<CompanyController>().InstancePerHttpRequest();
// or
builder.Register(x => x.Resolve<ISessionFactory.
().OpenSession()).InstancePerHttpRequest();
Exception
Method not found: 'Autofac.Builder.IRegistrationBuilder
3<!0,!1,!2> Autofac.Builder.IRegistrationBuilder
3.InstancePerMatchingLifetimeScope(System.Object)'.
StackTrace
at Autofac.Integration.Mvc.RegistrationExtensions.InstancePerHttpRequest[TLimit,TActivatorData,TStyle](IRegistrationBuilder`3 registration) at DMS.Website.MvcApplication.Application_Start() in d:\Code\Onset\DOT\trunk\DMS\DMS.Website\Global.asax.cs:line 167