app.UseMvcWithDefaultRoute();提示未处理的异常
这怎么解决了
这怎么解决了
2020-04-08
通过查找百度找到问题了!
在ASP.NET Core 2.2中,新增了一种路由,叫做Endpoint
(终结点)路由。本文将以往的路由系统称为传统路由
。
本文通过源码的方式介绍传统路由和Endpoint
路由部分核心功能和实现方法,具体功能上的差异见官方文档。
在升级到ASP.NET Core 2.2后,会自动启用Endpoint
路由
public void ConfigureServices(IServiceCollection services)
{
//添加
services.AddMvc(options => options.EnableEndpointRouting = false)
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}
举报