PM> Install-Package AspNetCore.RouteAnalyzer
Control + Shift + P
Nuget Install
AspNetCore.RouteAnalyzer
Startup.cs
using AspNetCore.RouteAnalyzer; // Add
.....
public void ConfigureServices(IServiceCollection services)
{
....
services.AddRouteAnalyzer(); // Add
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
....
app.UseMvc(routes =>
{
routes.MapRouteAnalyzer("/routes"); // Add
....
});
}
Cannot use 'AspNetCore.RouteAnalyzer.Inner.Router' with Endpoint Routing
このようなエラーになる場合は次のように書き換えましょう
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
↓
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);