title: Self-host of ASP.NET MVC application
body: <p>I have a full-working ASP.NET MVC application (consisting of 5 assemblies, .NET 4.5.1, ASP.NET MVC 5.2.2) which runs fine in Visual Studio (which uses IISExpress).</p>
  
  <p>I would now like to have a console application which takes the MVC application and hosts it (self hosting).</p>
  
  <p>I tried with <code>Microsoft.Owin.Host.HttpListener</code> and <code>Nancy.Owin</code> but while I get 404 pages my configurations lacks the mapping to my MVC-app.</p>
  
  <p>I got</p>
  
  <pre><code>public class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          app.UseNancy();
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    static void Main(string[] args)
      {
          StartOptions so = new StartOptions("http://localhost:9000/");
          using (WebApp.Start&lt;Startup&gt;(so))
          {
              Console.WriteLine("Press Enter to Exit");
              Console.ReadLine();
          }
      }
  </code></pre>
  
  <p>But obviously the configuration to use <code>MyMvcApplication</code> from the running MVC application is missing. How to do that? Or how to selfhost it otherwise?</p>
  
  <p>The answers I found on the web refer to older versions and I was hoping to have a more easy way today.</p>