title: custom application_start code for umbraco website
body: <p>I read that for umbraco to run my code on application startup I need to inherit from umbraco.Global and override Application_Start.  I've done that with the following simple code which resides in it's own assembly referenced by the umbraco web site project, and in it's bin folder.</p>
  
  <pre><code>public class AtomicF1Global : umbraco.Global
  {        
      protected override void Application_Start(object sender, EventArgs e)
      {
          base.Application_Start(sender, e);
  
          new WindsorStarter().Start();
  
          throw new Exception("Reached Custom Global");
      }
  }
  </code></pre>
  
  <p>The exception is in there purely to prove to me it wasn't being called.  </p>
  
  <p>As far as I know all I need to do is what I've done.  I don't need to update an umbraco table anywhere (as is the case when making a number of different modications to umbraco).</p>
  
  <p>However, my code is never being called and I've not been able to find out why.  Do I need to register something somewhere?</p>
  
  <p>I've also checked to ensure "App_Global.asax.dll" is not present in the bin directory.</p>
  
  <p>I have also tried creating a Global.asax in the umbraco site project that looks like this:</p>
  
  <pre><code>&lt;%@ Application Language="C#" Inherits="umbraco.Global" %&gt;
  &lt;%@ Import Namespace="atomicf1.domain" %&gt;
  
  &lt;script runat="server"&gt;
  
      void Application_Start(object sender, EventArgs e) 
      {
          // Call Global base class first
          base.Application_Start(sender, e);
  
  
          // Code that runs on application startup
          new WindsorStarter().Start();
  
          throw new Exception("Reached Custom Global");
  
      }             
  &lt;/script&gt;
  </code></pre>
  
  <p>Version of umbraco is 4.7.1 (.NET 4.0).</p>