title: Api controllers work but web razor controllers don't with owin
body: <p>I'm getting crazy with this.</p>
  
  <p>I'm developing an ASP.NET Web Api 2.2 project with Visual Studio 2012 Premium, .NET Framework 4.5.1 and C#.</p>
  
  <p>I have created an empty <code>ASP.NET MVC 5</code> project. I have deleted <code>Global.asax</code> and create this <code>Startup.cs</code> class:</p>
  
  <pre><code>using Microsoft.Owin;
  using Ninject;
  using Ninject.Web.Common.OwinHost;
  using Ninject.Web.WebApi.OwinHost;
  using Owin;
  using System.Reflection;
  using System.Web.Http;
  using System.Web.Routing;
  using MyProject.Web.API.App_Start;
  
  [assembly: OwinStartup(typeof(MyProject.Web.API.Startup))]
  namespace MyProject.Web.API
  {
      public class Startup
      {
          public void Configuration(IAppBuilder app)
          {
              RouteConfig.RegisterRoutes(RouteTable.Routes);
  
              var webApiConfiguration = new HttpConfiguration();
              webApiConfiguration.Routes.MapHttpRoute(
                  name: "Default",
                  routeTemplate: "{controller}/{id}",
                  defaults: new { id = RouteParameter.Optional });
  
              webApiConfiguration.Routes.MapHttpRoute(
                  name: "DefaultApi",
                  routeTemplate: "api/{controller}/{id}",
                  defaults: new { id = RouteParameter.Optional }
              );
  
              webApiConfiguration.Routes.MapHttpRoute(
                  name: "ProductionOrderActionApi",
                  routeTemplate: "api/MyProductionOrders/{orderNumber}/{action}",
                  defaults: new { controller = "MyProductionOrders" });
  
              app.UseNinjectMiddleware(CreateKernel);
              app.UseNinjectWebApi(webApiConfiguration);
          }
  
          private static StandardKernel CreateKernel()
          {
              var kernel = new StandardKernel();
              kernel.Load(Assembly.GetExecutingAssembly());
  
              RegisterServices(kernel);
  
              return kernel;
          }
  
          private static void RegisterServices(IKernel kernel)
          {
              var containerConfigurator = new NinjectConfigurator();
              containerConfigurator.Configure(kernel);
          }
      }
  }
  </code></pre>
  
  <p>The project works fine with <a href="https://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&amp;l=En-uS&amp;k=k(System.Web.Http.ApiController);k(ApiController);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5.1);k(DevLang-csharp)&amp;rd=true" rel="nofollow">ApiController</a> classes, but when I try to access to a <a href="https://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&amp;l=En-us&amp;k=k(System.Web.Mvc.Controller);k(Controller);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5.1);k(DevLang-csharp)&amp;rd=true" rel="nofollow">Controller</a> I get HTTP 404 Status code: not found.</p>
  
  <p>What do I have to do to allow Web pages? I think the problem is with <code>Routes</code> but I have tried to add <code>RouteConfig</code> to the project, but I don't know how.</p>
  
  <p>I have searched a lot on Google but I haven't found anything related to my question (or maybe I haven't put the correct search term).</p>
  
  <p>If you need <code>NinjectConfigurator</code> class, please tell me and I add it.</p>