title: web api in an external assembly under asp.net application
body: <p>I have a set of web APIs which contained inside a web application.</p>
  
  <p>I'm trying to separate them into a new dll under the publishing folder of the web app.</p>
  
  <p>After the separation and with the following routing code the individual api calling is successful.</p>
  
  <p>But I need the initialization code like Ninject initialization and routing register that are originally inside of Application_Start() of the web application to be put inside of the new dll. How can I do that so that the relevant code could be called before the first api invoke?</p>
  
  <pre><code>routes.MapHttpRoute(
  name: "DefaultApi",
  routeTemplate: "api/{controller}/{id}",
  defaults: new { id = RouteParameter.Optional }
  );
  </code></pre>