Skip to content

A simple demo listing all services available to an app at startup

License

Notifications You must be signed in to change notification settings

ardalis/AspNetCoreStartupServices

Repository files navigation

NuGetNuGet Build and Test .NET CI

ASP.NET Core ListStartupServices Middleware Package

A diagnostic middleware nuget package for listing all services registered with Startup in an ASP.NET Core applications.

Getting Started

  1. Install the nuget package.
  2. Add the following at the bottom of Startup's ConfigureServices method:
services.Configure<ServiceConfig>(config =>
{
    config.Services = new List<ServiceDescriptor>(services);
    
    // optional - default path to view services is /listallservices - recommended to choose your own path
    config.Path = "/mylistallservicespath";
});
  1. Add the following to your Configure method (in an if block so it only runs in dev environemnt)
if (env.IsDevelopment())
{
    app.UseShowAllServicesMiddleware();
    app.UseDeveloperExceptionPage();
}

If it's working you should see output like this showing all of your services:

image

Reference

About

A simple demo listing all services available to an app at startup

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages