title: Implement autofac in asp.net web form
body: <p>I am developing ASP.net Web Form, and I want to implement AutoFac into the website.</p>
  <p>I have followed the steps in following link:
  <a href="https://autofaccn.readthedocs.io/en/latest/integration/webforms.html" rel="nofollow noreferrer">https://autofaccn.readthedocs.io/en/latest/integration/webforms.html</a></p>
  <p>But I got this error:</p>
  <blockquote>
  <p>This module requires that the HttpApplication (Global Application Class) implements IContainerProviderAccessor.</p>
  </blockquote>
  <p>I can't find <code>Global.asax.cs</code> in my project, only <code>Global.asax</code>.</p>
  <p><code>Global.asax</code>:</p>
  <pre><code>&lt;%@ Application Language=&quot;C#&quot; %&gt;
  &lt;%@ Import Namespace=&quot;Autofac&quot; %&gt;
  &lt;%@ Import Namespace=&quot;Autofac.Integration.Web&quot; %&gt;
  &lt;script RunAt=&quot;server&quot;&gt;
      public class Global : HttpApplication, IContainerProviderAccessor {
  
          // Provider that holds the application container.
          static IContainerProvider _containerProvider;
  
          // Instance property that will be used by Autofac HttpModules
          // to resolve and inject dependencies.
          public IContainerProvider ContainerProvider {
              get { return _containerProvider; }
          }
  
          void Application_Start(object sender, EventArgs e) {
              // Code that runs on application startup
  
              // Build up your application container and register your dependencies.
              var builder = new ContainerBuilder();
              //builder.RegisterType&lt;SomeDependency&gt;();
              // ... continue registering dependencies...
  
              // Once you're done registering things, set the container
              // provider up with your registrations.
              _containerProvider = new ContainerProvider(builder.Build());
          }
      }
  &lt;/script&gt;
  </code></pre>
  <p>Any ideas? Thank you very much!</p>