设置索引主页而不是Azures此移动应用已启动并正在运行

时间:2016-05-04 09:36:29

标签: asp.net-mvc azure

我在Route.Config中的所有重定向工作正常,而不是我的主页默认链接显示Azure这个移动应用已启动并正在运行

  

http://localhost:51540/

Bellow是我的RouteConfig代码

 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("");



            routes.MapRoute(
    name: "/Index",
    url: "Index/{id}",
    defaults: new { controller = "MyController", action = "Index", id = UrlParameter.Optional }
);

当我在没有/ index的情况下添加我的代码时,我得到404> http://localhost:51540/和> http://localhost:51540/Index

  routes.MapRoute(
        name: "without /index",
        url: "{controller}/{action}/{id}",
       defaults: new { controller = "MyController", action = "Index", id = UrlParameter.Optional }
    );

有谁知道我在哪里可以更改此配置/设置?

问候!

1 个答案:

答案 0 :(得分:1)

在Startup.MobileApp.cs中调用了.UseDefaultConfiguration()方法。其中一部分是AddMobileAppHomeController(),它依赖于相应的Microsoft.Azure.Mobile.Server.Controllers.HomeController引用。我相信这会阻碍你实施你正在做的事情。

Helpful post and announcement about that