This worked for me when I was using -beta2 of the Mvc 5 nuget package.
However upgrading to -rc1 causes this error:
[HttpException (0x80004005): Inheritance security rules violated while overriding member: 'Autofac.Integration.Mvc.AutofacDependencyResolver.GetService(System.Type)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9913001
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
I see this was issue was already fixed: https://code.google.com/p/autofac/issues/detail?id=453
--
You received this message because you are subscribed to the Google Groups "Autofac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autofac+u...@googlegroups.com.
To post to this group, send email to aut...@googlegroups.com.
Visit this group at http://groups.google.com/group/autofac.
For more options, visit https://groups.google.com/groups/opt_out.
If your services are registered in the container, then it sounds like the dependency resolver is not being invoked.Make sure you have set the dependency resolver instance:var container = builder.Build();DependencyResolver.SetResolver(new AutofacDependencyResolver(container));For more information see the existing MVC documentation. This should still be relevant for MVC 5.Cheers,Alex.
I noticed the MVC5 version is marked as Stable, however the WebApi5 is Pre-Release... Is there going to be Stable for each now that RTM is out?
Thanks,
Troy