Skip to content

Instantly share code, notes, and snippets.

@duncansmart
Created January 21, 2016 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duncansmart/157cce7058b89fcb2318 to your computer and use it in GitHub Desktop.
Save duncansmart/157cce7058b89fcb2318 to your computer and use it in GitHub Desktop.
How to ensure a an ASP.NET web app is fully compiled at startup
using System;
using System.Web;
// ...
namespace Foo
{
public class MyWebApp : System.Web.HttpApplication
{
protected void Application_Start()
{
var cbm = new System.Web.Compilation.ClientBuildManager(HttpRuntime.AppDomainAppId, null);
cbm.PrecompileApplication();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment