title: Global.asax not firing on precompiled Sitefinity project
body: <p>I'm trying to launch a Sitefinity 4.2 project. As part of the project I need to register some controls within the global.asax file, like so:</p>
  
  <pre><code>    protected void Application_Start(object sender, EventArgs e) {
  
          //log call
          logStartUpCall(string.Concat("Application started at: ", DateTime.Now));
  
          Telerik.Sitefinity.Abstractions.Bootstrapper.Initialized += new EventHandler&lt;Telerik.Sitefinity.Data.ExecutedEventArgs&gt;(Bootstrapper_Initialized);
  
          //log call
          logStartUpCall(string.Concat("Call made to bootstrapper: ", DateTime.Now));
      }
  
      protected void Application_OnStart(object sender, EventArgs e) {
  
          //log call
          logStartUpCall(string.Concat("Application started at: ", DateTime.Now));
  
          Telerik.Sitefinity.Abstractions.Bootstrapper.Initialized += new EventHandler&lt;Telerik.Sitefinity.Data.ExecutedEventArgs&gt;(Bootstrapper_Initialized);
  
          //log call
          logStartUpCall(string.Concat("Call made to bootstrapper: ", DateTime.Now));
      }
  
      protected void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args) {
  
          //log call
          logStartUpCall(string.Concat("Bootstrapper_Initialized:", " ", DateTime.Now));
  
          //register dialogs for custom module fields
          Telerik.Sitefinity.Web.UI.Dialogs.RegisterDialog&lt;SitefinityModuleFields.Dialogs.SimpleImageSelectorDialog&gt;();
          logStartUpCall(string.Concat("Simple Image Selector dialog registered at:", " ", DateTime.Now));
          Telerik.Sitefinity.Web.UI.Dialogs.RegisterDialog&lt;SitefinityModuleFields.Dialogs.SimpleVideoSelectorDialog&gt;();
          logStartUpCall(string.Concat("Simple Video Selector dialog registered at:", " ", DateTime.Now));
          Telerik.Sitefinity.Web.UI.Dialogs.RegisterDialog&lt;ioscms.AppCode.ModuleFields.SimpleDocumentSelectorDialog&gt;();
          logStartUpCall(string.Concat("Simple Document Selector dialog registered at:", " ", DateTime.Now));
  
          //log call
          logStartUpCall(string.Concat("Dialogs registered at: ", DateTime.Now));
  
      }
  
      protected void logStartUpCall(string message) {
  
          TextWriter tw = new StreamWriter(System.Web.Hosting.HostingEnvironment.MapPath("/App_Data/SiteFinity/Logs/Startup.log"), true);
  
          // write a line of text to the file
          tw.WriteLine(message);
  
          // close the stream
          tw.Close();
  
      }
  </code></pre>
  
  <p>This works perfectly in normal debug mode. I am using a Web Deployment Project to deploy the project. This of course precompiles the website. the settings I am using are:</p>
  
  <p>SingleAssembly
  UpdateAble: true
  DebugSymbols: false</p>
  
  <p>The other thing with sitefinity is that the app can't be precompiled, so the PrecompiledApp.config file has to be deleted.</p>
  
  <p>The problem I'm experiencing is that the Application_Start (I've also tried Application_OnStart) is never executed, so of course the dialogs are never registered.</p>
  
  <p>I've also tried the option "Merge each individual folder output to its own assembly" with no avail.</p>
  
  <p>Does anyone have any ideas?</p>
  
  <p>Thanks in advance
  higgsy</p>