将RouteConfig代码修改为如下

    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapMvcAttributeRoutes();

            routes.MapRoute(
                name: "Home",
                url: "{controller}/{action}",
                defaults: "index"
            );
        }
    }

随后打开IIS管理器中的默认文档功能

MVC下设置默认页为index.html

将index.html移至第一个即可

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-11-16
  • 2021-11-03
猜你喜欢
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案