Asp.net core mvc 在.Net核心MVC中,IgnoreRoute和RouteExistingFiles的替代品是什么?

Asp.net core mvc 在.Net核心MVC中,IgnoreRoute和RouteExistingFiles的替代品是什么?,asp.net-core-mvc,Asp.net Core Mvc,ASP.NET MVC具有RouteExistingFiles方法和RouteCollection上的IgnoreRoute方法: routes.RouteExistingFiles = true; routes.IgnoreRoute("{*relpath}", new { relpath = @"(.*)?\.(css|js|htm|html)" }); ASP.NET Core不再具有这些方法。如何让静态文件先于动态内容服务?在mvc之前将静态文件中间件添加到pipepline。你可以看

ASP.NET MVC具有RouteExistingFiles方法和RouteCollection上的IgnoreRoute方法:

routes.RouteExistingFiles = true;
routes.IgnoreRoute("{*relpath}", new { relpath = @"(.*)?\.(css|js|htm|html)" });

ASP.NET Core不再具有这些方法。如何让静态文件先于动态内容服务?

在mvc之前将静态文件中间件添加到pipepline。你可以看报纸