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.
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");
}
}
The exception is in there purely to prove to me it wasn't being called.
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).
However, my code is never being called and I've not been able to find out why. Do I need to register something somewhere?
I've also checked to ensure "App_Global.asax.dll" is not present in the bin directory.
I have also tried creating a Global.asax in the umbraco site project that looks like this:
<%@ Application Language="C#" Inherits="umbraco.Global" %>
<%@ Import Namespace="atomicf1.domain" %>
<script runat="server">
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");
}
</script>
Version of umbraco is 4.7.1 (.NET 4.0).