OWIN self-service MVC5 returns 404

I created a simple web application using MVC5 and ASP.NET 4.5. Using this web application as a startup project works great when launched locally. I am trying to convert this to a standalone OWIN application, so I added a console program to the project and installed it as a startup project in Visual Studio (I use Community 2013).

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 works fine and does not cause any errors. However, when I try to reach this URL, all I get is a blank page, which is actually a 404 error page (I have no content on the page, but looking at the network trace, I see that the answer is 404).

This is the WebApp launch class:

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
        }
    }

, , ( ). , - , - , , OWIN MVC5.

+4
1

OWIN MVC 5. MVC, . MVC 6 . MVC 5 System.Web IIS, . MVC 6, OWIN IIS IIS Express.

MVC 6 , - :

public class Startup
{
    public void Configure(IApplicationBuilder app)
    {
        app.UseMvc();
    }

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();
    }
}

-, WebAPI 2+ SignalR 2, Dependency System.Web OWIN.

+5

All Articles