Get all registered routes in ASP.NET Core

I’ve created the NuGet package “AspNetCore.RouteAnalyzer” that provides a feature to get all route information.

Try it if you’d like.

Usage

Package Manager Console

PM> Install-Package 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
        ....
    });
}

Browse

Run project and you can access the url /routes to view all route information of your project.

Leave a Comment