我已经添加了我厌倦的内容,我正在尝试在ConfigureServices方法中设置mvcoptions.enableendpointrouting
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
DeveloperExceptionPageOptions developerExceptionPageOptions = new DeveloperExceptionPageOptions()
{
SourceCodeLineCount = 1
};
app.UseDeveloperExceptionPage(developerExceptionPageOptions);
}
app.UseStaticFiles();
app.UseMvcWithDefaultRoute();
欢迎来到该网站。您可以通过以下方式启用/禁用端点路由:
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(x => x.EnableEndpointRouting = false);
...
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)