core3.0 app.UseMvcWithDefaultRoute(); 问题
报错!
services.AddMvc();
//改成
services.AddMvc(options => { options.EnableEndpointRouting = false; })
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
//就可以,请问老师 这是为什么?
报错!
services.AddMvc();
//改成
services.AddMvc(options => { options.EnableEndpointRouting = false; })
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
//就可以,请问老师 这是为什么?
2020-01-02
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(options => { options.EnableEndpointRouting = false; })
.SetCompatibilityVersion(Microsoft.AspNetCore.Mvc.CompatibilityVersion.Version_3_0);
}
不知道别人是怎样的,我还需要将楼主提问中的CompatibilityVersion变更为(Microsoft.AspNetCore.Mvc.CompatibilityVersion,最终代码如上所示
举报