I read that for umbraco to run my code when the application starts, I need to inherit from umbraco.Global and override Application_Start. I did this with the following simple code, which is in its own assembly, referenced by the umbraco website project, and it has a bin folder in it.
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"); } }
An exception is there to prove that it was not called.
As far as I know, all I have to do is what I did. I do not need to update the umbraco table anywhere (as happens when creating a number of different modifications for umbraco).
However, my code is never called, and I could not figure out why. Do I need to register somewhere?
I also checked that "App_Global.asax.dll" was not present in the bin directory.
I also tried creating Global.asax in the umbraco site project, which looks like this:
<%@ Application Language="C#" Inherits="umbraco.Global" %> <%@ Import Namespace="atomicf1.domain" %> <script runat="server"> void Application_Start(object sender, EventArgs e) { </script>
Umbraco version is 4.7.1 (.NET 4.0).
Rob gray
source share