Code Monkey home page Code Monkey logo

aspnetcorestartupservices's Introduction

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

aspnetcorestartupservices's People

Contributors

ardalis avatar azure-pipelines[bot] avatar thunder860 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aspnetcorestartupservices's Issues

All these Dependencies?

Steve I was using an older listservices method from you. Today, starting up asp.net core 3.1 application and came across this now nuget.

I went to install and the following dialog scared me. I am currently building asp.net core 3.1 web application and your package wants to install the following dependencies...(even aspnetcore 1.1 dll's?)

Is this correct (it is going to reference all these other packages?)

2019-12-16_15-10-10

Web

Updates:

runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.0 -> runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl.4.3.1
System.Net.Http.4.3.0 -> System.Net.Http.4.3.2

Installing:

Ardalis.ListStartupServices.1.1.3
Libuv.1.9.1
Microsoft.AspNetCore.1.1.0
Microsoft.AspNetCore.Diagnostics.1.1.0
Microsoft.AspNetCore.Diagnostics.Abstractions.1.1.0
Microsoft.AspNetCore.Hosting.1.1.0
Microsoft.AspNetCore.Http.1.1.0
Microsoft.AspNetCore.HttpOverrides.1.1.0
Microsoft.AspNetCore.Routing.1.1.0
Microsoft.AspNetCore.Routing.Abstractions.1.1.0
Microsoft.AspNetCore.Server.IISIntegration.1.1.0
Microsoft.AspNetCore.Server.Kestrel.1.1.0
Microsoft.CodeAnalysis.Analyzers.1.1.0
Microsoft.CodeAnalysis.Common.1.3.0
Microsoft.CodeAnalysis.CSharp.1.3.0
Microsoft.CodeAnalysis.VisualBasic.1.3.0
Microsoft.DiaSymReader.Native.1.4.1
Microsoft.Extensions.Configuration.EnvironmentVariables.1.1.0
Microsoft.Extensions.Logging.Console.1.1.0
Microsoft.Extensions.Options.ConfigurationExtensions.1.1.0
Microsoft.Extensions.PlatformAbstractions.1.1.0
Microsoft.NETCore.App.1.1.2
Microsoft.NETCore.DotNetHost.1.1.0
Microsoft.NETCore.DotNetHostPolicy.1.1.2
Microsoft.NETCore.DotNetHostResolver.1.1.0
Microsoft.NETCore.Jit.1.1.2
Microsoft.NETCore.Runtime.CoreCLR.1.1.2
Microsoft.NETCore.Windows.ApiSets.1.0.1
Microsoft.VisualBasic.10.1.0
runtime.native.System.Net.Security.4.3.0
System.Diagnostics.FileVersionInfo.4.0.0
System.Diagnostics.Process.4.3.0
System.Diagnostics.StackTrace.4.3.0
System.Dynamic.Runtime.4.3.0
System.IO.FileSystem.Watcher.4.3.0
System.IO.MemoryMappedFiles.4.3.0
System.IO.UnmanagedMemoryStream.4.3.0
System.Linq.Parallel.4.3.0
System.Linq.Queryable.4.3.0
System.Net.Requests.4.3.0
System.Net.Security.4.3.1
System.Net.WebHeaderCollection.4.3.0
System.Numerics.Vectors.4.3.0
System.Reflection.DispatchProxy.4.3.0
System.Reflection.Metadata.1.4.1
System.Resources.Reader.4.3.0
System.Runtime.Loader.4.3.0
System.Security.Claims.4.3.0
System.Threading.Overlapped.4.3.0
System.Threading.Tasks.Dataflow.4.7.0
System.Threading.Tasks.Parallel.4.3.0
System.Threading.Thread.4.3.0
System.Threading.ThreadPool.4.3.0
System.Xml.XPath.4.0.1
System.Xml.XPath.XDocument.4.0.1

Add GitHub Actions and NuGet Publishing

Create a build and publish github action and ensure all NuGet fields are in the project file. Use another project like Ardalis.Specification or Ardalis.SmartEnum or Ardalis.GuardClauses and their GitHub actions/projects as a reference.

Add Parameter for Path

Currently the middleware catches all routes and terminates, which is only useful if you toggle it on and off using something like a specific environment. A better approach would be to only listen on a specified (and probably required) route that would be passed in as a parameter, like so:

app.UseShowAllServicesMiddleware("/ListServices");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.