title: Implemented IHttpModule class events does not firing, SharePoint 2010 issue
body: <p>I'm developing sharepoint 2010 web appliation. I want to handle some Applicaton events (Begin_Request, End_Request, Application_Start) in manner of classic asp.net way through the using Global.asax inherited from SPHttpApplication.</p>
  
  <p>I found
  <a href="http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/79f69293-a91c-4426-acac-ff23030db1ee" rel="nofollow noreferrer">two way </a> 
  to distinguish that.</p>
  
  <p>The first one suggests to overload SPHttpApplication in Global class. Good idea but not suitable for me because my application is deployed to sub-site of another main site. If there is a way to get around this moment it would be a great solution!</p>
  
  <p>The second one suggests to implement IHttpModule interface and register events from HttpApplication context variable. It is suitable for me and I created class library project with one class implementing this interface. I've also add special record in my web.config file:</p>
  
  <pre><code>&lt;httpModules&gt;
      &lt;add name="DSModule" type="Artec.DS.HttpContext.DSModule, DSModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31a3567341f39f94"/&gt;
  &lt;/httpModules&gt;
  </code></pre>
  
  <p>where 'Artec.DS.HttpContext' is a project name and DSModule is a class name.
  And after all when I'm starting debug, 'Init()' method is not called.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>namespace Artec.DS.HttpContext
  {
      public class DSModule : IHttpModule
      {
          public void Dispose()
          {
             throw new NotImplementedException();
          }
  
          public void Init(HttpApplication context)
          {
              System.Diagnostics.Debugger.Launch();
  
              ApplicationVariables.AppPath = context.Server.MapPath("/");
              NhibernateManager.Init();
              NavigationManager.Init();
          }
      }
  }
  </code></pre>
  
  <p>First of all my web.config has wrong "type" attribute. I was confused with class name instead of assembly name. So well-formed tag is as follow:</p>
  
  <pre><code>&lt;add name="DSModule" type="Artec.DS.HttpContext.DSModule, Artec.DS.HttpContext, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31a3567341f39f94" /&gt;
  </code></pre>
  
  <p>After modification of web.config system.webServer/modules (thanks to <a href="https://stackoverflow.com/users/17966/cbono">CBono</a>) Init() was called and this is an answer on my initial question.</p>
  
  <p>But now I get error: "System.Web.HttpException: Server operation is not available in this context." when trying to map server path:</p>
  
  <pre><code>context.Server.MapPath("/")
  </code></pre>