title: Compile/Pre-compile global.asax only
body: <p>Is there a way to compile or precompile just the global.asax file to a dll and use it in the bin folder?</p>
  
  <p>I have a license logic in this file and other files won't be compiled by me.</p>
  
  <p>I could also check if the dll itself exists in bin folder.</p>
  
  <pre><code>void Application_BeginRequest(object sender, EventArgs e)
      {
         //Application is allowed to run only on specific domains
         string[] safeDomains = new string[] { "localhost" };
         if(!((IList)safeDomains).Contains(Request.ServerVariables["SERVER_NAME"]))
         {
             Response.Write("Thisweb application is licensed to run only on: "
             + String.Join(", ", safeDomains));
             Response.End();
         }
      }
  </code></pre>