I have created a simple web application using MVC5 and ASP.NET 4.5. Using that web application as the startup project works just fine when running locally. I'm trying to convert this to an OWIN self-hosted application so I have added a Console program to the project and set it as the startup project in Visual Studio (I'm using 2013 Community).
This is my Program class:
class Program
{
static void Main(string[] args)
{
using (Microsoft.Owin.Hosting.WebApp.Start<WebApp.Startup>("http://localhost:9000"))
{
Console.WriteLine("Press [enter] to quit...");
Console.ReadLine();
}
}
}
This runs fine and doesn't trigger any error. However when I try to reach that URL, all I get is a blank page which is actually a 404 error page (I don't have any content in the page, but looking at the network trace I see that the response is a 404).
This is the Startup class of WebApp:
public class Startup
{
public void Configuration(IAppBuilder app)
{
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888
}
}
Yes, it's empty because I don't have much to do (there's no authentication or database schema update to trigger). I'm sure I'm missing something obvious but I can't seem to find any article detailing what is required to make OWIN hookup correctly to a MVC5 project.