title: WebAPI application_start not executing on IIS server
body: <p>I am building a new WebAPI service. So far it has one endpoint that calls a method in my Logic project that calls a method in my EF Repository project. It works when I run it in IIS Express in Visual Studio. When I publish it to an IIS site (IIS 7.5), I get a 404 Not Found and it appears as though application_start never runs. I added code to application_start to throw an exception and I never see that exception, just the 404 Not Found. 
  I created the service in Visual Studio 2015. I used the ASP.NET Web Application (.NET Framework) project type. In the dialog that follows that selection, I chose the Empty template and select the checkbox to add folders and core references for Web API. Based on those selections, the project has the following Nuget packages installed: Microsoft.AspNet.WebApi, Microsoft.AspNet.WebApi.Client, Microsoft,AspNet.WebApi.Core, and Microsoft.AspNet.WebApi.WebHost. (It's got a few other packages, but those are all the WebApi packages. 
  My global.asax.cs code looks like this: </p>
  
  <pre><code>public class WebApiApplication : System.Web.HttpApplication
  {
      protected void Application_Start()
      {
          //throw new ApplicationException("This is just a test");
          GlobalConfiguration.Configure(WebApiConfig.Register);
      }
  }
  </code></pre>
  
  <p>And my WebApiConfig.Register method looks like this: </p>
  
  <pre><code>    public static void Register(HttpConfiguration config)
      {
          // Web API configuration and services
  
          // Web API routes
          config.MapHttpAttributeRoutes();
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  </code></pre>
  
  <p>But, as I said, I don't believe any of the above code is executing when I deploy the code to IIS. When I un-comment the throw statement in Application_Start, I never see the exception thrown. I've also at times, while debugging this problem, had a Sleep(60000) statement in Application_Start. Run in IIS Express in Visual Studio, I can see that one minute delay. When deployed to IIS it fails instantly with a 404 - no one minute delay. </p>
  
  <p>What would make Application_Start <em>not</em> run? </p>