title: Autofac with MVC 4 action filter property injection
body: <p>I am using the Nuget MVC3 integration package for Autofac with MVC4. It mostly works (constructor injection with Controllers is working great) but it does not inject registered services into action filter properties. </p>
  
  <p>This is my registration in Global.asax.cs:</p>
  
  <pre><code>builder.RegisterType&lt;AspNetMembershipProviderWrapper&gt;().As(typeof(IUserService)).InstancePerHttpRequest();
  // 5) action filters
  builder.RegisterType&lt;SetCultureAttribute&gt;().As&lt;IActionFilter&gt;().PropertiesAutowired().SingleInstance();
  builder.RegisterFilterProvider();
  var container = builder.Build();
  DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
  </code></pre>
  
  <p>Then in the <code>SetCultureAttribute</code> I have this:</p>
  
  <pre><code>public IUserService _userService { get; set; } // it doesn't get injected, null
  </code></pre>
  
  <p>Nor does this work in the constructor of the attribute:</p>
  
  <pre><code>_userService = DependencyResolver.Current.GetService&lt;AspNetMembershipProviderWrapper&gt;(); // always returns null
  </code></pre>
  
  <p><code>DependencyResolver.Current.GetService()</code> also returns null for all other registered services when called within the action filter's constructor (I tried it out in the Debug windows to test it).</p>
  
  <p>So I guess something is not working right. Is it ok to use MVC3 integration or should I use MVC4 Nuget package (which says it's for RC)?</p>
  
  <p>Is there anything else I could try to make this work?</p>